Skip to content

Instantly share code, notes, and snippets.

@hpk42
Created October 11, 2013 10:15
Show Gist options
  • Save hpk42/6932496 to your computer and use it in GitHub Desktop.
Save hpk42/6932496 to your computer and use it in GitHub Desktop.
location ~ \+f/ {
try_files $uri @proxy_to_app;
}
location ~ \+doc/ {
try_files $uri @proxy_to_app;
}
location / {
proxy_pass http://localhost:3141;
proxy_set_header X-outside-url $scheme://$host;
proxy_set_header X-Real-IP $remote_addr;
}
location @proxy_to_app {
proxy_pass http://localhost:3141;
proxy_set_header X-outside-url $scheme://$host;
proxy_set_header X-Real-IP $remote_addr;
}
@hpk42
Copy link
Author

hpk42 commented Oct 11, 2013

revised (only one repetition left):

location ~ \+(f|doc)/ {
    try_files $uri @proxy_to_app;
}
location / {
    proxy_pass http://localhost:3141;
    proxy_set_header  X-outside-url $scheme://$host;
    proxy_set_header  X-Real-IP $remote_addr;
}   
location @proxy_to_app {
    proxy_pass http://localhost:3141;
    proxy_set_header  X-outside-url $scheme://$host;
    proxy_set_header  X-Real-IP $remote_addr;
} 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment