Problems with redirects

Reinis Rozitis r at
Tue Oct 15 13:08:19 UTC 2019

> The problem is, whatever URL I put in the browser, it redirects to
> _______________________________________________

> server_name *;
> return 301 https://$server_name$request_uri; }

For that I don't think you can use $server_name here because it will always be the first one picked no matter if the client passes in Host header.

Try with return 301 https://$host$request_uri;


More information about the nginx mailing list