Skip to content

Instantly share code, notes, and snippets.

@graue
Created January 24, 2013 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graue/4622755 to your computer and use it in GitHub Desktop.
Save graue/4622755 to your computer and use it in GitHub Desktop.
Potsfyi nginx proxying config
upstream potsfyi {
server 127.0.0.1:8000 fail_timeout=0;
}
server {
listen 4004;
server_name _;
keepalive_timeout 10;
location / {
proxy_pass http://potsfyi;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /static/ {
root /home/pi/code/potsfyi; # allows access only to 'static' subdir
}
}
@graue
Copy link
Author

graue commented Feb 5, 2013

I had to modify line 12:

proxy_set_header Host $host:4004;

to get the port right, otherwise some redirects were breaking.

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