Skip to content

Instantly share code, notes, and snippets.

@shivampip
Created December 4, 2020 21:00
Show Gist options
  • Save shivampip/2582c168baa6c3d204f8b396cd9853c2 to your computer and use it in GitHub Desktop.
Save shivampip/2582c168baa6c3d204f8b396cd9853c2 to your computer and use it in GitHub Desktop.
Nginx wildcard subdomain to folder
server{
listen 80;
server_name ~^(?<subdomain>.*)\.yoursite\.com$;
root /var/www/project/sites/$subdomain;
index index.html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment