Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (52 sloc) 1.38 KB
# vim: set filetype=nginx ts=2:softtabstop=2
server {
listen 4001;
server_name sym-test.localhost.com;
root /Users/jack/sym-test;
location ~* ^\/(files|images|stylesheets|javascripts|flash) {
access_log off;
expires 1d;
}
location ^~ /files/ {
internal;
}
location ^~ /inaccessible/ {
internal;
}
location / {
# rewrite ^/f/(.*) /assets/download/$1 last;
proxy_redirect off;
index index.html index.htm;
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;
# check if the file exists and serve it
if (-e $request_filename) {
access_log off;
expires 1d;
break;
}
# check for an index file, and serve that
if (-e $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
# rails page caching
if (-e $request_filename.html) {
rewrite (.*) $1.html break;
}
# route traffic to site cluster
if (!-e $request_filename) {
break;
}
}
error_page 404 /404.html;
location = /404.html {
root /Users/jack/sym-test;
}
# redirect server error pages to the static page /500.html
error_page 500 502 503 504 /500.html;
location = /50x.html {
root /Users/jack/sym-test;
}
}