Skip to content

Instantly share code, notes, and snippets.

@natp0ng
Created November 15, 2014 09:42
Show Gist options
  • Save natp0ng/3551a0442c291b8917df to your computer and use it in GitHub Desktop.
Save natp0ng/3551a0442c291b8917df to your computer and use it in GitHub Desktop.
Nginx wildcard configuration
# *.example.com
server {
listen 80;
listen [::]:80;
server_name ~^(?<subdomain>.+)\.example\.com$;
access_log /srv/web/example.com/logs/nginx_access.log vhost_combined;
error_log /srv/web/example.com/logs/nginx_error.log;
root /srv/web/example.com/subdomains/$subdomain/htdocs;
index index.php index.html index.htm;
include global/restrictions.conf;
include global/php.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment