Permanent redirects break when using port forwarding

Description

When using port forwarding, e.g. -p 8443:443 with Docker, the permanent redirects that have been added will break.

⇒ curl --silent --output /dev/null --insecure --dump-header /dev/stdout https://xxx:yyy@192.168.56.10:8443/ HTTP/1.1 301 Moved Permanently Server: nginx Date: Fri, 02 Mar 2018 14:43:40 GMT Content-Type: text/html Content-Length: 178 Location: https://192.168.56.10/graph/ Connection: keep-alive Strict-Transport-Security: max-age=63072000; includeSubDomains X-Frame-Options: DENY X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Cache-Control: no-store Pragma: no-cache

Prefixing the destination with $scheme://$http_host/ will detect and use the correct information:

⇒ curl --silent --output /dev/null --insecure --dump-header /dev/stdout https://xxx:yyy@192.168.56.10:8443/ HTTP/1.1 301 Moved Permanently Server: nginx Date: Fri, 02 Mar 2018 14:51:33 GMT Content-Type: text/html Content-Length: 178 Connection: keep-alive Location: https://192.168.56.10:8443/graph/ Strict-Transport-Security: max-age=63072000; includeSubDomains X-Frame-Options: DENY X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Cache-Control: no-store Pragma: no-cache

PR to follow

How to test

None

How to document

None

Activity

Mykola Marzhan 
March 5, 2018 at 11:49 AM

, many thanks!
merged

Nailya Kutlubaeva 
March 5, 2018 at 8:04 AM

confirmed

Roma Novikov 
March 4, 2018 at 5:23 PM

pls verify this Bug. Should we add some basic tests with PMM on the unusual port?  

, please take a look to PR 

C W 
March 2, 2018 at 3:05 PM

I have added rules for the password-page as well, but have not tested those

Done

Details

Assignee

Reporter

Priority

Components

Labels

Fix versions

Affects versions

Created March 2, 2018 at 3:00 PM
Updated March 6, 2024 at 7:48 AM
Resolved March 6, 2018 at 9:55 PM

Flag notifications