Skip to content

Instantly share code, notes, and snippets.

@JuneKelly
Created May 24, 2014 20:48
Show Gist options
  • Save JuneKelly/42d75b947c19dfa5d9d4 to your computer and use it in GitHub Desktop.
Save JuneKelly/42d75b947c19dfa5d9d4 to your computer and use it in GitHub Desktop.
Nginx conf for a proxied site
server {
listen 80;
server_name {{SERVER_NAME}};
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:{{PORT}}/;
}
location /static/ {
access_log off;
log_not_found off;
add_header Pragma "public";
add_header Cache-Control "public";
expires modified 10d;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:{{PORT}}/static/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment