Last active
February 6, 2019 22:00
-
-
Save aadityataparia/edca37f8f2735347fb50b7801867f8ee to your computer and use it in GitHub Desktop.
Wildcard subdomains config in nginx
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 [::]:80 default; | |
listen 443 ssl; | |
index index.php index.html; | |
server_name ~^(?<subdomain>[^.]+).example.com; | |
root /var/www/$subdomain; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
abcd.example.com
will be served from/var/www/abcd
folder