Created
October 11, 2017 02:12
-
-
Save manhg/490231810d64b262555ffc11c7430585 to your computer and use it in GitHub Desktop.
nginx development bind domain to port
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 { | |
resolver 127.0.0.1; | |
listen 80; | |
server_name "~^(?P<app_group>\w+)?(?:\.)?(?P<app_name>\w+)-(?P<app_port>\d{4})\.devel$"; | |
root /work/$app_name/public; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_pass http://localhost:$app_port; | |
proxy_redirect http://localhost:$app_port/ /; | |
} | |
error_log /usr/local/var/log/apps.log warn; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment