-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Allow the use of relative redirects #12161
base: main
Are you sure you want to change the base?
Conversation
including docs, configmap
including docs, configmap
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: chriss-de The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Hi @chriss-de. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
fixed typo in e2e fct call
@chriss-de thanks for your contribution Could you consider creating an issue first for this. It would help so much if a layman needed complete descriptive and accurate explaining of what the problem is why it is important for the project to change its code, is available as issue description (along with the answers to questions asked in the template of a new bug report). Additionally it will help to know how many users benefit from the proposed changes. Many things happened and so some decisions were made. We focus now on security & Gateway-API . We also deprecated multiple features that are potentially popular but don't help in maintaining & supporting a secure & stable controller. Hence absolute critical definitive data is needed during triaging, as the resources are really strained so not possible for developers to triage and clone and test etc etc etc. thanks |
@@ -125,6 +125,11 @@ type Backend struct { | |||
// Default: false | |||
UsePortInRedirects bool `json:"use-port-in-redirects"` | |||
|
|||
// Enables or disables relative redirects. By default nginx uses absolute redirects. | |||
// http://nginx.org/en/docs/http/ngx_http_core_module.html#absolute_redirect | |||
// Default: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the default current is true, we should keep it that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well yes. Thats why the config value relative-redirects is default false - so the nginx config flag absolute_redirect can be true (as it is in default).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could make it all (configmap & annotation) with the name absolute-redirect
But then you would have to add an annotation (or configmap) where you set the value explicitly to false
to get the behavior. Works both for me.
First thought was to inverse the logic of absolute_redirect
to relative-redirects so you have to say yes
to get the new behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so?! leave at it is? resolved?
golangci-lint gets OOM killed |
With this PR it is possible to use relative redirects as described in RFC7231 (section 7.1.2).
Nginx has a config flag
absolute_redirect
that ison
by default and cannot be changed via annotation or configmap.This PR allows the user to switch
absolute_redirect
off.This annotation/configmap setting is named relative-redirect and inverses the logic to not conflict with the default settings.
What this PR does / why we need it:
This change let you use relative redirects instead of the absolute redirects nginx uses in default.
Types of changes
Which issue/s this PR fixes
#12162
How Has This Been Tested?
This PR includes e2e tests
Checklist: