Welcome! Log In Create A New Profile

Advanced

Re: how to trigger "proxy_next_upstream invalid_header"?

Jeffrey 'jf' Lim
January 27, 2018 09:40AM
On Thu, Jan 25, 2018 at 8:22 PM, Roman Arutyunyan <arut@nginx.com> wrote:
> Hi Jeffrey,
>
> On Thu, Jan 25, 2018 at 05:41:50PM +0800, Jeffrey 'jf' Lim wrote:
>> This is more of a curiosity thing, I guess, than anything else, but...
>> how do you trigger an "proxy_next_upstream invalid_header" when
>> testing?
>>
>> I've tried basically sending random text from an upstream ('nc -l')...
>> but nginx holds on to the connection and ends up triggering a
>> "timeout" instead. If I send random text, and then close the
>> connection, the random text still gets sent to the client, and no next
>> peer is tried.
>
> The easiest way is to send the status line + header bigger than
> proxy_buffer_size bytes. Another way is to send a null byte somewhere in the
> response header. You can also try sending broken line and header termination:
> CR followed by a non-LF byte.
>

thank you, Roman. I actually tried using the null byte and "CR
followed by non-LF" method first. Those, despite what I tried,
unfortunately did not work (for a null byte, I tried various places in
response headers: part of the header name, part of the header value;
no luck). In the end though, I managed to do it by sending a large
header, and that worked.

thanks,
-jf
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

how to trigger "proxy_next_upstream invalid_header"?

Jeffrey 'jf' Lim January 25, 2018 04:44AM

Re: how to trigger "proxy_next_upstream invalid_header"?

Roman Arutyunyan January 25, 2018 07:24AM

Re: how to trigger "proxy_next_upstream invalid_header"?

Jeffrey 'jf' Lim January 27, 2018 09:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 298
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready