Skip to content

Instantly share code, notes, and snippets.

@colinrotherham
Created June 25, 2015 11:49
Show Gist options
  • Save colinrotherham/76ab837870e8adffe81e to your computer and use it in GitHub Desktop.
Save colinrotherham/76ab837870e8adffe81e to your computer and use it in GitHub Desktop.
Nginx proxy pass
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