»

Rails

Configuring Multiple Rails Apps on a single NginX Server

11.11.07 | Comment?

It is very simple to add multiple rails apps in your NginX server. Here I’m using an example of 2 rails apps with 3 mongrels serving each app. This is what you need to do in your nginx.conf.

upstream mongrel_app1 {
server 127.0.0.1:1000;
server 127.0.0.1:1001;
server 127.0.0.1:1002;
}

upstream mongrel_app2 {
server 127.0.0.1:2000;
server 127.0.0.1:2001;
server 127.0.0.1:2002;
}

Server {

….

if (!-f $request_filename) {
proxy_pass http://mongrel_app1;
break;
}

}

Server {

….

if (!-f $request_filename) {
proxy_pass http://mongrel_app2;
break;
}

}

If you’re not sure about the setting up of the entire rails stack, try this link.

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

:

:



»