Created
February 17, 2020 07:28
-
-
Save samsulmaarif/00b0440fb3cf807c5f20e2c93296637b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat list-migrasi-domain.txt | |
domain-lama1.com --> domain-baru1.com | |
domain-lama2.com --> domain-baru2.com | |
domain-lama3.com --> domain-baru3.com | |
domain-lama4.com --> domain-baru4.com | |
paste -d ' ' `pwd`/list-migrasi-domain.txt | while read lama skip baru; do echo "server {\n\t server_name $lama;\n\t rewrite ^/(.*)\$ http://$baru/\$1 permanent;\n}" >> direktif-baru.txt; done | |
cat direktif-baru.txt | |
server { | |
server_name domain-lama1.com; | |
rewrite ^/(.*)$ http://domain-baru1.com/$1 permanent; | |
} | |
server { | |
server_name domain-lama2.com; | |
rewrite ^/(.*)$ http://domain-baru2.com/$1 permanent; | |
} | |
server { | |
server_name domain-lama3.com; | |
rewrite ^/(.*)$ http://domain-baru3.com/$1 permanent; | |
} | |
server { | |
server_name domain-lama4.com; | |
rewrite ^/(.*)$ http://domain-baru4.com/$1 permanent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment