Skip to content

Redirect to https does not replace the http port correctly when specifying use-port-in-redirects in configmap #1882

@cristic83

Description

@cristic83

NGINX Ingress controller version:
quay.io/aledbf/nginx-ingress-controller:0.296

Kubernetes version (use kubectl version):
oc v3.6.1+008f2d5
kubernetes v1.6.1+5115d708d7

Environment:

Cloud provider or hardware configuration: AWS
OS (e.g. from /etc/os-release):
NAME="Red Hat Enterprise Linux Server"
VERSION="7.2 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.2"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.2:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.2"

Kernel (e.g. uname -a):
Linux ip-10-0-110-21.eu-west-1.compute.internal 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

Install tools:
OpneShift

What happened:

Using a configuration map specified with the config flag --configmap that contains use-port-in-redirects: "true", the nginx-ingress controller doesn't work properly:
`curl http://my-domain:8080/health -v

Trying 127.0.0.1...
Connected to my-domain (127.0.0.1) port 8080 (#0)
GET /health HTTP/1.1
Host: my-domain:8080
User-Agent: curl/7.47.0
Accept: /
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.13.7
< Date: Fri, 05 Jan 2018 12:24:51 GMT
< Content-Type: text/html
< Content-Length: 185
< Connection: keep-alive
< Location: https://my-domain:8080:8843/health`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions