You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We let the user to change the ports through the $HTTP and $HTTPS environment variables, but the Nginx server section that has the configuration for the redirect from http:// to https:// don't use this configuration (default.conf.template#L3), so the redirect to the secure URL still lack of the port number that is defaulted by any browser to 443.
Changing the expression from:
return 301 https://$host$request_uri;
To:
return 301 https://$host$request_uri:${HTTPS};
Doesn't work, Nginx returns something like this in the HTTP 301 response header:
Note the / character before the : that makes the URL invalid.
Moreover, if the user only change the HTTP port but not the HTTPS port which may be the case in many configurations, the URL will include :443 at the end, which is valid but undesired (because 443 is the default and is ugly to see the number that isn't needed).
Related: if possible, we should refrain from returning a 301 as that's cached as opposed to 302 which will be checked every request. In the case we want to go back to using http and have been sending 301, we'll have to fight browser cache etc.
Not sure if this is easy or buried in the docker stack somewhere hard to get to.
mrsarm
changed the title
When HTTPS port changed the HTTP redirect still redirects to port 80
When HTTPS port changed the HTTP redirect still redirects to port 443
Mar 17, 2021
mrsarm
changed the title
When HTTPS port changed the HTTP redirect still redirects to port 443
When HTTPS port is changed requests to HTTP still redirect to port 443
Mar 18, 2021
We let the user to change the ports through the
$HTTP
and$HTTPS
environment variables, but the Nginxserver
section that has the configuration for the redirect fromhttp://
tohttps://
don't use this configuration (default.conf.template#L3), so the redirect to the secure URL still lack of the port number that is defaulted by any browser to 443.Changing the expression from:
To:
Doesn't work, Nginx returns something like this in the HTTP 301 response header:
Note the
/
character before the:
that makes the URL invalid.Moreover, if the user only change the HTTP port but not the HTTPS port which may be the case in many configurations, the URL will include
:443
at the end, which is valid but undesired (because 443 is the default and is ugly to see the number that isn't needed).CC @newtewt
The text was updated successfully, but these errors were encountered: