Skip to content

Instantly share code, notes, and snippets.

@justdoit0823
Created July 14, 2018 07:17
Show Gist options
  • Save justdoit0823/5100d7178d8f342cb349cb3b8a9991aa to your computer and use it in GitHub Desktop.
Save justdoit0823/5100d7178d8f342cb349cb3b8a9991aa to your computer and use it in GitHub Desktop.
remove path prefix in nginx
# Use rewrite directive
location ^~ /apps/ {
rewrite ^/apps/(.*) /$1 break;
proxy_pass http://127.0.0.1:3000$uri$is_args$args;
}
# Use location path match
location ^~ /apps/ {
proxy_pass http://127.0.0.1:3000/;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment