Skip to content

Instantly share code, notes, and snippets.

@yickling
Created June 7, 2017 13:49
Show Gist options
  • Save yickling/ef20f7f1bd8341c2a46db05afe8b4e4d to your computer and use it in GitHub Desktop.
Save yickling/ef20f7f1bd8341c2a46db05afe8b4e4d to your computer and use it in GitHub Desktop.
Nginx rewrite path to point back to root
# This will rewrite 1.2.3.4/sub back to 1.2.3.4:3000
location /sub {
rewrite /sub(.*) $1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment