39 lines
801 B
Text
39 lines
801 B
Text
upstream thin_cluster {
|
|
server unix:/tmp/thin.0.sock;
|
|
server unix:/tmp/thin.1.sock;
|
|
server unix:/tmp/thin.2.sock;
|
|
server unix:/tmp/thin.3.sock;
|
|
}
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
server_name localhash.com www.localhash.com;
|
|
root /opt/applications/example;
|
|
|
|
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 off;
|
|
proxy_buffering off;
|
|
|
|
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://thin_cluster;
|
|
break;
|
|
}
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
|
|
}
|
|
|