Skip to content

Instantly share code, notes, and snippets.

@stephennancekivell
Created September 4, 2012 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephennancekivell/3619082 to your computer and use it in GitHub Desktop.
Save stephennancekivell/3619082 to your computer and use it in GitHub Desktop.
nginx proxy_pass forwarding
# ends up at 127.0.0.1:8080
location /bla/ {
rewrite ^/bla/(.*) $1 break;
proxy_pass http://127.0.0.1:8080/;
}
# doesnt end up at 127.0.0.1:8080/woo
location /bla/ {
rewrite ^/bla/(.*) $1 break;
proxy_pass http://127.0.0.1:8080/woo;
}
# ends up at 127.0.0.1:8080/woo
location /bla/ {
rewrite ^/bla/(.*) /woo/$1 break;
proxy_pass http://127.0.0.1:8080/;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment