So I have two domains – http://www.mysite.com and sub.mysite.com
sub.mysite.com is used by a number of legacy apps that can’t be updated for varying reasons, and their requests to URLs on that domain need to keep working. However, the code is being moved from the Rails application at sub.mysite.com, and will be integrated into http://www.mysite.com
The plan, at the moment, is to have the sub.mysite.com content available at http://www.mysite.com/sub, but I’m at a loss on how to get nginx to render content from http://www.mysite.com/sub as if it’s coming from sub.mysite.com
I’ve tried a couple of rewrite rules in the nginx config, but they keep redirecting me to http://www.mysite.com/sub URLs instead of sticking with the sub.mysite.com address.
At the bottom of my nginx config, I’ve currently got:
server{
listen 80;
server_name sub.mysite.com;
location / {
proxy_redirect off;
proxy_pass http://www_server/sub;
}
}
Is what I’m asking for even possible?
If I got it right what you want is this:
Hope it helps.