Created
October 1, 2014 08:41
-
-
Save xcambar/4b25abde72d5fa37b2e8 to your computer and use it in GitHub Desktop.
NGinx configuration to proxy Grunt from a subdir
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
set $front_port "9000"; | |
set $front_host "10.0.2.2"; | |
location @proxy_to_front { | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Protocol $scheme; | |
rewrite ^/app(.*) $1 break; | |
proxy_pass http://$front_host:$front_port; | |
} | |
location /app { | |
try_files $uri @proxy_to_front; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment