Skip to content

Instantly share code, notes, and snippets.

@oc
Created October 8, 2012 17:56
Show Gist options
  • Select an option

  • Save oc/3853917 to your computer and use it in GitHub Desktop.

Select an option

Save oc/3853917 to your computer and use it in GitHub Desktop.
upstream blah-muda-no-backend {
server unix:/var/run/unicorn/blah-muda-no.sock fail_timeout=0;
}
server {
server_name blah.muda.no;
client_max_body_size 10m;
root /srv/www/blah.muda.no/public;
access_log /var/log/nginx/blah.muda.no.access.log;
keepalive_timeout 5;
location ~ /(favicon.ico|robots.txt) {
access_log off;
log_not_found off;
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires 30d;
}
location = /favicon.ico {
expires 3M;
access_log off;
}
location / {
try_files $uri $uri/ @blah-muda-no-backend;
}
location @blah-muda-no-backend {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://blah-muda-no-backend;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment