Last active
August 29, 2015 14:06
-
-
Save gleicon/b1325364b1ced98ccb56 to your computer and use it in GitHub Desktop.
nginx per vhost documentroot + tag insert
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
server { | |
listen 80; | |
server_name ~^(www\.)?(?<siteid>.+)\.domain\.com$; | |
log_format timed_combined '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent ' | |
'"$http_referer" "$http_user_agent" ' | |
'$request_time $pipe'; | |
access_log /var/log/nginx/static_sites.domain.log timed_combined; | |
root /var/www/$siteid; | |
location / { | |
root /var/www/$siteid; | |
sub_filter </head> '\n<!-- insert tag for $siteid -->\n</head>'; | |
sub_filter_once on; | |
index index.html index.htm; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment