Wednesday, January 20, 2016

Subdomain Proxy/Rewrite with Nginx Proxy

I want to take m.example.com and direct those requests to example.com/mobile/ with nginx. (The same nginx sever will be serving example.com)



Can someone help me with the config I would need? I can post my nginx.conf if needed, but I assume its something like:



location / {
rewrite /([^/] +) /mobile/$1 break;
proxy_pass http://127.0.0.1;

}



Am I in the right ballpark?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...