14 messages in ru.sysoev.nginxRe: Improved nginx.conf for Ruby On R...
FromSent OnAttachments
Redd VinyleneOct 6, 2008 2:07 am 
W. Andrew Loe IIIOct 6, 2008 10:07 am 
Redd VinyleneOct 6, 2008 10:32 am 
ThomasOct 6, 2008 12:33 pm 
Maxim DouninOct 6, 2008 2:02 pm 
Ezra ZygmuntowiczOct 6, 2008 2:32 pm 
ThomasOct 7, 2008 12:39 am 
Igor ClarkOct 7, 2008 2:23 am 
Kenneth KalmerOct 7, 2008 3:35 am 
Ed WOct 7, 2008 9:54 am 
Redd VinyleneOct 14, 2008 8:25 am 
W. Andrew Loe IIIOct 15, 2008 11:22 am 
Redd VinyleneOct 16, 2008 4:27 am 
Dave CheneyOct 16, 2008 6:07 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Improved nginx.conf for Ruby On RailsActions...
From:W. Andrew Loe III (and@andrewloe.com)
Date:Oct 6, 2008 10:07:25 am
List:ru.sysoev.nginx

http://gist.github.com/15078

Special tweaks include enabling the first request of rails cached stylesheets to be served by the mongrel, but all future requests served by the web server. Far Futures expires. Support for 503'ing and displaying a maintenance page.

A lot of this was taken from Ezra Zygmuntowicz's post last year. http://brainspl.at/articles/2007/01/03/new-nginx-conf-with-optimizations

On Mon, Oct 6, 2008 at 2:07 AM, Redd Vinylene <redd@gmail.com> wrote:

I've been trying to improve the standard nginx.conf for Ruby On Rails (http://wiki.codemongers.com/NginxRubyonRailsMongrel) with the help of Maxim Dounin, and so far this is what we got:

-

user www www;

worker_processes 5;

events { worker_connections 1024; }

http {

include /usr/local/etc/nginx/mime.types;

default_type application/octet-stream;

sendfile on;

upstream mongrel {

server 127.0.0.1:5000;

server 127.0.0.1:5001;

server 127.0.0.1:5002;

}

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;

server {

listen 80;

server_name mysite.com www.mysite.com;

root /usr/local/www/mysite/public;

location / {

error_page 404 = @fallback;

}

location @fallback {

proxy_pass http://mongrel;

proxy_intercept_errors on;

recursive_error_pages on;

error_page 500 502 503 504 /500.html;

}

location = /500.html {}

Anybody care to chip in?