-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from-to-www-redirect not working with a wildcard #2230
Comments
@artemzakharov there is a bug in redirect, you can try oilbeater/nginx-ingress-controller-amd64:0.12.0 to see if it's ok now |
@oilbeater thank you, how can I try it out? I assume I need to reinstall with helm? |
@artemzakharov you can edit the ingress-controller deployment and change the image name |
@oilbeater I tried out the image, still doesn't redirect. |
can you paste the /etc/nginx/nginx.conf in the container,there should be a section like
|
Wasn't sure which one you wanted since there were many server sections, so here's the whole conf file.
|
@artemzakharov still trying to figure out why this happens, you can try to remove www.foo.com ingress rules to see if works |
@oilbeater I tried removing it, and this is what happens: |
the logical here is a little complex, try remove the |
I'm confused, did you want me to remove the logic from the nginx file itself? I removed it from the yaml file that defined the ingress resource, so I was left with this:
|
@artemzakharov Sorry, I found my mistake at the first place. Just rollback the image and only keep the www.foo.com rule. Hope this could work
|
Hey @oilbeater, that mostly works, but i get a certificate error and no redirect when i manually enter |
Duplicate of #2043 ? |
I am being impacted by this. Users accessing the non-www domain is messing up my analytics data. Any workarounds? I can't find any. |
Since we only have one relevant domain, we worked around this by using the "correct" certificate as the default tls ( '--default-ssl-certificate' ), but we are also being impacted by this. Any other workaround or correct way to do this? |
@djhmateer It might be at this point. I opened this issue after a comment by @aledbf on the older one suggested that the behavior was intentional and I simply needed a wildcard certificate to fix things, but that turned out to be wrong, so I thought this was a separate issue altogether. In any case, we'll see if this issue persists when the original one is resolved. |
@artemzakharov this should be fixed in 0.16.2. |
I found a hacky workaround that might be useful to others. I made an S3 bucket that does a redirect from root to www and setup a cloudfront distribution with my wildcard certificate pointing to that bucket. I then pointed my root dns to the cloudfront distribution. Things get redirected from root to www using https as expected with this setup. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
same here! any news? |
I'm also having this issue. Any news? |
Is this a request for help?: Request for bug fix
What keywords did you search in NGINX Ingress controller issues before filing this one?: wildcard www redirect
Is this a BUG REPORT or FEATURE REQUEST?: Bug
NGINX Ingress controller version: not sure, installed via the latest chart on Helm yesterday
Kubernetes version (use
kubectl version
): 1.9.4-gke.1Environment:
uname -a
):What happened:
I have a wildcard certificate that was issued to
*.foo.com
, in all lowercase. I have set up the ingress like this, with the intention of redirecting all naked domain traffic towww.foo.com
, which the certificate covers.The ingress, however, does not redirect traffic from the base domain - going to
foo.com
in the browser leaves me athttps://foo.com
instead ofhttps://www.foo.com
, and no redirect takes place.What you expected to happen:
I expected all traffic going to the naked domain to be redirected.
How to reproduce it (as minimally and precisely as possible):
The text was updated successfully, but these errors were encountered: