2

I have a nginx + passenger + single rails app setup in a Fedora server. My nginx.conf regarding my app looks something like this:

server {
    listen 80;
    server_name myapp.mycompany.com;
    root /opt/apps/myapp_large_name/public;
    passenger_enabled on;
    client_max_body_size 4M;
}

So when I access myapp.mycompany.com.br it access to my rails app under /opt/apps/myapp_large_name/public. I want to be able to configure a subpath to access to another app (in this case, monit). I want something like that:

myapp.mycompany.com.br/monit access the monit app.

Is it possible?

Rubem Azenha
  • 675
  • 3
  • 8
  • 15

1 Answers1

2

Found a way to do it:

server {
    listen 80;
    server_name name myapp.mycompany.com;
    root /opt/apps/myapp_large_name/public;
    passenger_enabled on;
    client_max_body_size 4M;

    location /monit/ {
      rewrite ^/monit/(.*)$ /$1 break;
      proxy_pass http://localhost:2812;
    }

}
Rubem Azenha
  • 675
  • 3
  • 8
  • 15