Created
June 25, 2015 11:49
-
-
Save colinrotherham/76ab837870e8adffe81e to your computer and use it in GitHub Desktop.
Nginx proxy pass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream somewhere | |
{ | |
server localhost:4000; | |
} | |
server | |
{ | |
location / | |
{ | |
try_files $uri @proxy; | |
} | |
location @proxy | |
{ | |
proxy_pass http://somewhere; | |
proxy_http_version 1.1; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
} | |
location /or/a/specific/path | |
{ | |
proxy_pass http://www.somewhere-else.com/file.js; | |
expires 1w; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment