Description
Is this a request for help?: No, bug
What keywords did you search in NGINX Ingress controller issues before filing this one?: force-www, ssl, https, kubernetes ingress controller fake certificate
Is this a BUG REPORT or FEATURE REQUEST?: bug
NGINX Ingress controller version: 0.9.1
Kubernetes version: 1.8.5
Environment: GKE
- Cloud provider or hardware configuration: Google Cloud
- OS (e.g. from /etc/os-release): Container OS
- Kernel (e.g.
uname -a
): - Install tools: Helm
- Others: n/a
What happened: I have an app I would like to host on www.foo.com
. My nginx ingress has the from-to-www-redirect
flag enabled to redirect requests from the base domain url, and has a TLS secret to provide for secure connections. This combination of redirect and SSL works for most url inputs, but not one in particular - https://foo.com
. In this case, browsers present a security warning like this:
Attackers might be trying to steal your information from foo.com (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_AUTHORITY_INVALID
Subject: Kubernetes Ingress Controller Fake Certificate
Issuer: Kubernetes Ingress Controller Fake Certificate
Expires on: Feb 1, 2019
Current date: Feb 7, 2018
PEM encoded chain:
...
Forcing the browser to proceed to the "unsafe" site redirects to the correct destination of https://www.foo.com
and enables SSL like nothing ever happened. For reference, the following urls all redirect to https://www.foo.com
with no warnings:
foo.com
http://foo.com
www.foo.com
http://www.foo.com
What you expected to happen: I expect https://foo.com
to redirect to https://www.foo.com
without browsers displaying a false alarm.
How to reproduce it (as minimally and precisely as possible):
- Set up an application on GKE
- Place it behind an nginx ingress configured to enable
from-to-www-redirect
and SSL via a certificate, with a subdomain host likewww.foo.com
pointing to the application service - Attempt to reach the application with
https://<base-domain>
.
Anything else we need to know:
Here's my nginx ingress config file:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: foo-https-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
spec:
rules:
- host: www.foo.com
http:
paths:
- backend:
serviceName: foo-prod-front
servicePort: 80
path: /
tls:
- hosts:
- www.foo.com
secretName: tls-secret