0

I want to move a ruby app from:
app.domain.com
To:
domain.com/app

Currently:

server_name app.domain.com    
location / {
        proxy_pass       http://localhost:9001;
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

Is it possible to set something like:

server_name domain.com 
location /app/ {
        proxy_pass       http://localhost:9001;
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

And add some directive in nginx that makes "domain.com/app/" the root of the application so I don't have to rewrite every path?
So that if the app has href="/" it translates to "domain.com/app/" instead of "domain.com/"?

1 Answer 1

0

Change the location block back to what you had earlier, and change the root directive in your configuration, add app/ to the end of the directive.

This way your web root directory will be current web root + app/.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .