<div dir="auto"><div>The host is defined by the server, surely, and not by what the client tells the server it is? And you tell the server what host it is by the server_name directive (<a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#server_name">https://nginx.org/en/docs/http/ngx_http_core_module.html#server_name</a>).</div><div dir="auto"><br></div><div dir="auto">-jf<br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Sat, 24 Aug 2019, 01:39 Nuno Gonçalves, <<a href="mailto:nunojpg@gmail.com">nunojpg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am using proxy_pass and I'm facing a issue which I'm not sure it's a bug.<br>
<br>
It is in regard to the behaviour specified by the documentation [1]:<br>
<br>
If a location is defined by a prefix string that ends with the slash<br>
character, and requests are processed by one of proxy_pass,<br>
fastcgi_pass, uwsgi_pass, scgi_pass, memcached_pass, or grpc_pass,<br>
then the special processing is performed. In response to a request<br>
with URI equal to this string, but without the trailing slash, a<br>
permanent redirect with the code 301 will be returned to the requested<br>
URI with the slash appended. If this is not desired, an exact match of<br>
the URI and location could be defined like this:<br>
<br>
Consider that there is a proxy pass for location /abcd/ { proxy_pass<br>
... } for a server listening on port 80.<br>
<br>
If I make a request for /abcd with Host header "<a href="http://example.com:8080" rel="noreferrer noreferrer" target="_blank">example.com:8080</a>",<br>
then I receive a 301 for <a href="http://example.com/abcd/" rel="noreferrer noreferrer" target="_blank">example.com/abcd/</a> and not for the expected<br>
<a href="http://example.com:8080/abcd/" rel="noreferrer noreferrer" target="_blank">example.com:8080/abcd/</a>.<br>
<br>
In fact NGINX is considering the Host header domain part, but<br>
disregarding the port part.<br>
<br>
I believe this is a bug.<br>
<br>
Thanks,<br>
Nuno<br>
<br>
[1] <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html" rel="noreferrer noreferrer" target="_blank">http://nginx.org/en/docs/http/ngx_http_core_module.html</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank" rel="noreferrer">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div></div></div>