Welcome! Log In Create A New Profile

Advanced

nginx + mongrel + ruby on rails caching images and css etc.

Posted by mpjokine 
nginx + mongrel + ruby on rails caching images and css etc.
February 02, 2010 04:32AM
Hi,

I have a server configuration where there is a front end running nginx and two application servers running RoR application and four mongrels among a few other services on both servers. Front end and app servers are running on different ip:s so that front end only forwards requests to app servers.

My problem is that because front end (nginx) is located on other ip than the app, it seems that I cannot tell nginx to cache images and css files by writing something like:

[code]
location ~* \.(js|css|jpg|jpeg|gif|png)$ {
if (-f $request_filename) {
expires max;
break;
}
}
[/code]

If running nginx and app server on the same machine this works fine. Is there any rather easy solution for this?

Thank you in advance.

--
mj
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready