Skip to content

Instantly share code, notes, and snippets.

@func09
Created March 22, 2011 10:55
Show Gist options
  • Save func09/881052 to your computer and use it in GitHub Desktop.
Save func09/881052 to your computer and use it in GitHub Desktop.
upstream backend-unicorn-foodfoto {
server unix:/tmp/unicorn_of_foodfoto.sock;
}
server {
listen 80;
server_name devremote.foodfoto.info;
access_log /var/log/nginx/devremote.foodfoto.info.access.log;
error_log /var/log/nginx/devremote.foodfoto.info.error.log;
root /home/app/deploy/foodfoto/current/public;
if (-e $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/maintenance.html last;
break;
}
location ~ .*\.(jpg|JPG|gif|GIF|png|PNG|swf|SWF|css|CSS|js|JS|inc|INC|ico|ICO)$ {
# root /home/app/deploy/foodfogo/current/public;
access_log off;
expires 30d;
break;
}
location / {
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 75;
client_max_body_size 10M;
if ( $request_filename ~* "\.(css|js|png)(\?[0-9]+)?$" ) {
access_log off;
expires 30d;
}
if (-f $request_filename) {
break;
}
proxy_pass http://backend-unicorn-foodfoto;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment