-
Notifications
You must be signed in to change notification settings - Fork 224
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
Conflict between more_set_input_headers and map #105
Comments
Note that while debugging, we found a workaround. Apparently, if the map is resolved BEFORE calling Just change
to
And everything is ok again... |
Not sure if this helps, but we traced the ending In error situation, debug log shows something like this:
And when everything is as it should be:
So, if the destination is a directory, another internal redirect occur, causing the 301 Why? Sorry, my nginx debug knowledge ends here... |
Nginx's |
Delay the evaluation was our primary intention, mostly to avoid if (if is evil). After reading you answer and analysing the problem a bit more, I found another workaround. This that may indicate the bug is not within headers_more, but in reentrancy control (is there any?) of regex operations: Just change the errordocument location to:
Probably the header changes, and thus the map evaluation, thus the regex From this I can see these options to fix the problem, in order of cleanliness:
Maybe @igorsysoev, @mdounin or somebody else involved in core nginx development could take a look in options 1 or 2? |
@dioni21 Thanks for digging this up and sharing the root cause. I think it's already outside the scope of this module. You need to contact the nginx team for a fix. BTW, changing the running phase of this module is not an option, more like a hack to me and it would break backward-compatibility for existing users. |
Just to finish and leave another reference: I found a 6 year old 😭 reference in nginx bugtrack: https://trac.nginx.org/nginx/ticket/564 |
Hi,
I found a nasty bug in our setup! Better explain by example.
Suppose this configuration:
Now, let's do a request:
Perfect! Buf, if instead:
The text was updated successfully, but these errors were encountered: