Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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;
    }

}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.