Last active
November 7, 2017 17:24
-
-
Save drAlberT/74f9d8595c40caab9f86bc9f712fd797 to your computer and use it in GitHub Desktop.
Revisions
-
drAlberT revised this gist
Nov 7, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ -
drAlberT created this gist
Nov 7, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ A collection of snippets to be used as "user data" files in AWS instances creation (but not only) This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/usr/bin/env bash CONF_DIR="/etc/nginx/sites-enabled" OLD_DEFAULT="default" NEW_DEFAULT="api" # remove old default sed -i'' -e 's/\s*default_server\s*//' "${CONF_DIR}/${OLD_DEFAULT}" # set new default sed -i'' -e 's/\(\s*listen 80\);/\1 default_server;/' "${CONF_DIR}/${NEW_DEFAULT}" service nginx configtest && service nginx reload