nginx does not allow multiple lines in a header value?

Adam Greene adam at
Mon Feb 23 04:41:03 MSK 2009

hey folks,

I ran into a funny issue with nginx when working on accepting oauth calls.
Nginx is stripping the authorization header out if the field value contains
newlines.  Http 1.1 guidelines state that this is valid:

to recreate, do the following:
* add $http_authorization to your nginx 'log_format main' clause so you can
see what is happening (or print out the headers from wherever nginx proxies
the call to)

* run a curl command like this against your nginx server:
curl -d '' -H 'Authorization: OAuth realm="",

* you'll see the header value terminated after the first 'OAuth realm="",'
* try the same curl command but remove the return characters, and it will

the same behavior occurs when I strip out all proxy, compression, and ssl
and try to leave a very basic config file.  here is some information about

# nginx -V
nginx version: nginx/0.6.34
built by gcc 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
configure arguments: --sbin-path=/usr/sbin --conf-path=/etc/nginx/nginx.conf
--pid-path=/var/run/ --with-http_ssl_module

I'm a bit surprised that I'm seeing this and while I'm starting to suspect
nginx I'm sure it is possible that I'm missing something.  If this is a
valid bug, let me know what you would like in terms of additional
documentation, examples, etc.

thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list