Created
March 26, 2015 04:35
-
-
Save wicochandra/6012031585bc4371f149 to your computer and use it in GitHub Desktop.
Changed root directory in nginx configuration.
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 characters
#! /bin/sh | |
CONFIG_FILE="/etc/nginx/sites-available/project" | |
DIR=$1 | |
if [ $# -eq 0 ] | |
then | |
DIR='.' | |
fi | |
DIR=$(readlink -f $DIR) | |
CONFIG=$(sed "s@root[^\n]*@root $DIR;@g" < $CONFIG_FILE) | |
echo "$CONFIG" > $CONFIG_FILE | |
service nginx reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment