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

fix: http redirection to https #6910

Open
wants to merge 1 commit into
base: 4.0.x
Choose a base branch
from

Conversation

endekovski10
Copy link

@endekovski10 endekovski10 commented Mar 12, 2024

Issue

https://gravitee.atlassian.net/browse/APIM-4817

Description

Previously, our default configuration say that even if you enable TLS, we don't redirect HTTP to HTTPS.
By default (without our overwrite config) nginx says:

By default the controller redirects (308) to HTTPS if TLS is enabled for that ingress.

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#server-side-https-enforcement-through-redirect

So both case:

  • customer keep default and use HTTP
  • customer only enable TLS

will be handled correctly with default nginx configuration.

As we add nginx.ingress.kubernetes.io/ssl-redirect: "false" which is ok by default without TLS.
This mean that even if we enable TLS, the redirection is still disabled.

My proposal is to remove our default setting and keep the nginx default one to make both case (TLS or not) work properly:
enable redirection only if TLS is used.

@endekovski10 endekovski10 requested a review from a team as a code owner March 12, 2024 15:14
@endekovski10 endekovski10 marked this pull request as draft March 12, 2024 15:15
@passionne passionne force-pushed the fix/TT-4224-ssl-redirect branch 2 times, most recently from dc69471 to 3aa3858 Compare April 29, 2024 10:05
@passionne passionne marked this pull request as ready for review April 29, 2024 10:05
Previously, our default configuration say that
even if you enable TLS, we don't redirect HTTP to HTTPS.

By default (without our overwrite config) nginx says:

```
By default the controller redirects (308) to HTTPS if TLS is enabled for that ingress.
```
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#server-side-https-enforcement-through-redirect

So both case:

* customer keep default and use HTTP
* customer only enable TLS

will be handled correctly with default nginx configuration.

As we add nginx.ingress.kubernetes.io/ssl-redirect: "false" which is ok by default without TLS.
This mean that even if we enable TLS, the redirection is still disabled.

My proposal is to remove our default setting and keep the nginx default one
to make both case (TLS or not) work properly:
enable redirection only if TLS is used.

APIM-4817
TT-4224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants