Nginx dynamic proxy_pass keeps redirecting to wrong domain

Ruben D rdocter at gmail.com
Fri Nov 17 03:48:04 UTC 2017


In my browser bar I see the address beginning with instance-001. While I expect not to have a redirect and just see http://example.com/etc...

Is that what you mean?

Verstuurd vanaf mijn iPhone

> Op 16 nov. 2017 om 23:56 heeft Francis Daly <francis at daoine.org> het volgende geschreven:
> 
> On Thu, Nov 16, 2017 at 09:59:49PM +0100, Ruben wrote:
> 
> Hi there,
> 
>>        location / {
>>          proxy_pass http://$instance;
>>        }
> 
>> The problem is, when I go to http://example.com/cdn/test/test.jpg in the
>> browser, it redirects me to http://instance-001/cdn/test/test.jpg. Which is
>> ofcourse not correct. It should proxy the docker service with name
>> instance-001.
> 
> Are you reporting that nginx creates the redirect, or that nginx passes
> along the redirect that the upstream web server creates?
> 
> The two cases probably have different fixes.
> 
> What do the (nginx and upstream web server) logs say?
> 
>    f
> -- 
> Francis Daly        francis at daoine.org
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


More information about the nginx mailing list