Last active
September 27, 2015 20:58
-
-
Save gipi/1330564 to your computer and use it in GitHub Desktop.
Domain dependent web root directory in #nginx. Need version 0.7.40
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
| server { | |
| listen 80; ## listen for ipv4 | |
| # if we have www.miao.bau then the variables defined from | |
| # the regex are $1 = www and $2 = miao.bau | |
| server_name localhost ~^(www\.)?(.+)$; | |
| access_log /var/log/nginx/localhost.access.log; | |
| location / { | |
| root /var/www/$2; | |
| index index.html index.htm; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment