Skip to content

Instantly share code, notes, and snippets.

@fujin
Created October 8, 2008 21:53
Show Gist options
  • Save fujin/15613 to your computer and use it in GitHub Desktop.
Save fujin/15613 to your computer and use it in GitHub Desktop.
server {
listen 80;
client_max_body_size 50M;
server_name junglist.gen.nz;
root /home/aj/www/junglist/public/;
access_log /var/log/nginx/junglist.access.log;
if (-f $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/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;
proxy_max_temp_file_size 0;
if (-f $request_filename) {
break;
}
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://127.0.0.1:5000;
}
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /var/www/junglist/public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment