Skip to content
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

[nginx] ssl-redirect only defaults when at least one annotation is set #160

Closed
sander-su opened this issue Jan 23, 2017 · 5 comments · Fixed by #265
Closed

[nginx] ssl-redirect only defaults when at least one annotation is set #160

sander-su opened this issue Jan 23, 2017 · 5 comments · Fixed by #265

Comments

@sander-su
Copy link

SSLRedirect only defaults when at least one annotations is present on the ingress.
Hence, when no annotation is present on the ingress no 301 redirect is created.

Using nginx nginx-ingress-controller:0.8.3

The default is set in the ParseAnnotations method.
Is this method invoked when no annotations are set?

@sander-su sander-su changed the title ssl-redirect only defaults when at least one annotation is set [nginx] ssl-redirect only defaults when at least one annotation is set Jan 23, 2017
@rikatz
Copy link
Contributor

rikatz commented Jan 26, 2017

@sander-su Can you specify steps to reproduce this one?

I'm having some similar issue, but the need is not to specify some annotation, but specific ingress.kubernetes.io/rewrite-target: / annotation.

Also, after setting this, you have to change some of the items in 'location' array to a different path, then return it to '/'.

Additionally, there is a question here: Do we really expect those redirects to be global, as in nginx template they're by location?

@sander-su
Copy link
Author

I'd like to have them global.
Same like hsts setting.
However hsts is a browser hint and a 302 blocks also incomming traffic.

To reproduce: create an ingress rule without annotations.
We have no annotations on any ingress rule in the cluster.

@sander-su
Copy link
Author

bump
@aledbf

@rikatz
Copy link
Contributor

rikatz commented Feb 3, 2017

@sander-su Have tested this here also. I'm working now on other thing here (trying to improve the mutual authentication), but if you have any idea also in how to improve your issue in the code, will appreciate :)

@sander-su
Copy link
Author

Currently I do not have much time..
Don't know if it is possible by the template engine but the template should check if $location.Redirect.SSLRedirect is nil and then use the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants