Forum: Rails deployment Nginx: Multiple apps, one domain.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
00031576301fb98c831d7d2973e640d7?d=identicon&s=25 Nadav Blum (nadav)
on 2007-07-24 21:22
Hi all.
I guess I am not the first to encounter this...
I want to deploy some rails apps, using only one domain
(www.mydomain.com), so that www.mydomain.com/app1/... will be mapped to
the app1 directory,
www.mydomain.com/app2/... will be mapped to the app2 directory.

I would like to use nginx + mongrels
I couldn't figure out how to express this in the nginx config file.
I did something like :

http {
.
.
.

 # cluster serving app1
 upstream mongrel1 {
   server 127.0.0.1:7000;
   server 127.0.0.1:7001;
 }
 # cluster serving app2
 upstream mongrel2 {
   server 127.0.0.1:8000;
   server 127.0.0.1:8001;
 }

 server {
  .
  .
  .
  location /app1 {
    .
    .
    .
    proxy_pass http://mongrel_app1;
  }

  location /app2 {
    .
    .
    .
    proxy_pass http://mongrel_app2;
  }
 }

}

But this doesn't work, I get error messages in the production.log files
because the app1 / app2 prefixes are stll there for rails to figure out.



Thanks for your help



Nadav
A0c5c76e3c9ebf995d2514e743c08907?d=identicon&s=25 alex durgin (Guest)
on 2007-07-26 06:30
(Received via mailing list)
On Jul 24, 2:22 pm, Nadav Blum <ruby-forum-incom...@andreas-s.net>
wrote:
> http {
>  upstream mongrel2 {
>     .
>  }
> Posted viahttp://www.ruby-forum.com/.
take a look at the prefix option with mongrel:

http://mongrel.rubyforge.org/docs/howto.html
00031576301fb98c831d7d2973e640d7?d=identicon&s=25 Nadav Blum (nadav)
on 2007-07-26 15:31
alex durgin wrote:
> take a look at the prefix option with mongrel:
>
> http://mongrel.rubyforge.org/docs/howto.html

Thanks man, this was the problem. I added the prefix option to
config/mongrel_cluster.yml in each of the applications directories and
now it works fine.



Cheers



Nadav
This topic is locked and can not be replied to.