Skip to content

Instantly share code, notes, and snippets.

@jdelStrother
Last active December 19, 2015 21:18
Show Gist options
  • Select an option

  • Save jdelStrother/6019116 to your computer and use it in GitHub Desktop.

Select an option

Save jdelStrother/6019116 to your computer and use it in GitHub Desktop.
try_files $uri @app;
location @app {
# if the host looks like api.<something>/<somepath> then rewrite the request
# as /api/<somepath>
if ( $host ~* api\.(.*) && $path !~ ^/api) {
rewrite ^(.*)$ /api$1 last;
}
include "proxy.conf";
proxy_pass http://backend_app;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment