Welcome! Log In Create A New Profile

Advanced

Re: Improved nginx.conf for Ruby On Rails

Posted by Redd Vinylene 
Redd Vinylene
Re: Improved nginx.conf for Ruby On Rails
October 14, 2008 05:50PM
Nah, actually my config doesn't work at all. Maxim Dounin had no idea
it was for Rails, so I'm back to square one.

Unless y'all got something better than the brainspl.at one?

On Tue, Oct 7, 2008 at 6:54 PM, Ed W <[email protected]> wrote:
> 1) Needs some options for adding expires headers to static assets
> 2) I really like my config files templated as far as possible, ie chuck
> as much of the static stuff in a fixed file and make the main file just
> include it all in. If we could use variable names in a couple of extra
> places then the whole file could be templated...
> 3) Are you sure it handles rails page caching? Care to explain how?
>
> Ed W
>
>
>
> Redd Vinylene 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?
>>
>>
>
>
>



--
http://www.home.no/reddvinylene
Sorry, only registered users may post in this forum.

Click here to login