2

i am trying to use nginx for my hosted website on Azure using location. but even if i configure Nginx for google, i get a 404.

location /master 
{
proxy_pass http://www.google.com;   
}
Sonam
  • 57
  • 4

1 Answers1

0

See this thread for url details on proxy_pass

Nginx proxy_pass only works partially

Your config

location /master 
{
   proxy_pass http://www.google.com;   
}

Send /master also as the part of the url. Which means you are trying to go to http://www.google.com/master. So this won't work as it is a 404. But if you add trailing / to both your locations

location /master/ 
{
   proxy_pass http://www.google.com/;   
}

The /master will not be sent as the request url. Also this would just work for a brief moment as you will get a 301 to https://www.google.com. So better is to use proxy_pass https://www.google.com/;

Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265