Skip to content

Instantly share code, notes, and snippets.

@sevos
Created October 23, 2010 11:32
Show Gist options
  • Save sevos/642101 to your computer and use it in GitHub Desktop.
Save sevos/642101 to your computer and use it in GitHub Desktop.
upstream logo_contest_cluster {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name logo-contest.eax.pl;
access_log /home/sevos/apps/logo-contest/log/access.log;
error_log /home/sevos/apps/logo-contest/log/error.log;
root /home/sevos/apps/logo-contest/public;
index index.html;
if (-f $document_root/maintenance.html) {
rewrite ^(.*)$ /maintenance.html last;
break;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://logo_contest_cluster;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment