Last active
February 27, 2018 13:37
-
-
Save anthumchris/84a0ab1b8a98ad86869859589e883a9f to your computer and use it in GitHub Desktop.
Dynamically route subdomains to respective subdomain folders
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; | |
listen [::]:80; | |
server_name ~^(?<subdomain>\w+).dynamic.domain.com; | |
root /var/www/vhost/_dynamic/$subdomain; | |
access_log /var/log/nginx/dynamic-access.log; | |
error_log /var/log/nginx/dynamic-error.log; | |
autoindex on; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment