Created
May 11, 2016 23:15
-
-
Save chvanikoff/c3900124b0645ceee98a96a817b9568f to your computer and use it in GitHub Desktop.
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
upstream index { | |
server 127.0.0.1:4200; | |
} | |
upstream app1 { | |
server 127.0.0.1:4201; | |
} | |
upstream app2 { | |
server 127.0.0.1:4202; | |
} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
map $request_uri $app { | |
default "index"; | |
"~^/(?P<p>[^/]*).*" $p; | |
} | |
server { | |
listen 80; | |
server_name sub.domain.com; | |
location / { | |
rewrite ^/[^/]*/?(.*) /$1 break; | |
include proxy_params; | |
proxy_redirect off; | |
proxy_pass http://$app; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment