Skip to content

Instantly share code, notes, and snippets.

@xcambar
Created October 1, 2014 08:41
Show Gist options
  • Save xcambar/4b25abde72d5fa37b2e8 to your computer and use it in GitHub Desktop.
Save xcambar/4b25abde72d5fa37b2e8 to your computer and use it in GitHub Desktop.
NGinx configuration to proxy Grunt from a subdir
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