1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
# drop this into /etc/nginx/sites-enabled/ and tweak
# this nginx config reverse proxies to the 3 running thin instances
# started by the myapp.yml example
upstream thin {
server unix:/tmp/thin.0.sock;
server unix:/tmp/thin.1.sock;
server unix:/tmp/thin.2.sock;
}
server {
listen 80;
root /var/www/myapp/public/;
access_log /var/www/myapp/log/nginx.access.log;
error_log /var/www/myapp/log/nginx.error.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if (-f $request_filename) {
break;
}
if (!-f $request_filename) {
proxy_pass http://thin;
break;
}
}
error_page 500 502 503 504 /500.html;
error_page 404 403 /404.html;
}
|