Hi,
We are using nginx 0.7.68 and we encountered a small problem with the
underscores_in_headers directive.
Use case, 2 servers section :
server {
listen 80 default;
server_name *.domain.com;
…
}
server {
listen 80;
server_name titi.domain-b.com;
underscores_in_headers on;
…
}
In that case the underscores_in_headers directive of the second server
is not taken care of. To make it work we have to either remove ‘default’
option from the listen directive of the first server or add
‘underscores_in_headers on’ in the first server as well.
Regards.
–
Sylvain [email protected]
Hello!
On Mon, Dec 27, 2010 at 01:21:14PM +0100, Sylvain Rabot wrote:
In that case the underscores_in_headers directive of the second server
is not taken care of.
This is expected. Header parsing happens in context of default
server, before server_name matching (as server_name matching
requires parsing Host header).
To make it work we have to either remove ‘default’
option from the listen directive of the first server or add
‘underscores_in_headers on’ in the first server as well.
Just removing “default” from the first server won’t help, as first
defined server (for the listen socket in question) will be
implicitly selected as default anyway. Otherwise correct.
Maxim D.
On Mon, 2010-12-27 at 15:48 +0200, Maxim D. wrote:
underscores_in_headers on;
…
}
In that case the underscores_in_headers directive of the second server
is not taken care of.
This is expected. Header parsing happens in context of default
server, before server_name matching (as server_name matching
requires parsing Host header).
It makes sense. So shouldn’t this directive be in the ‘http’
configuration section only ?
To make it work we have to either remove ‘default’
option from the listen directive of the first server or add
‘underscores_in_headers on’ in the first server as well.
Just removing “default” from the first server won’t help, as first
defined server (for the listen socket in question) will be
implicitly selected as default anyway. Otherwise correct.
Maxim D.
–
Sylvain [email protected]
Hello!
On Mon, Dec 27, 2010 at 03:38:10PM +0100, Sylvain Rabot wrote:
Use case, 2 servers section :
server_name titi.domain-b.com;
requires parsing Host header).
It makes sense. So shouldn’t this directive be in the ‘http’
configuration section only ?
No, it’s still usable at server{} level for separate listen sockets
(i.e. non-virtual servers). Consider the following example:
server {
listen 127.0.0.1:80;
underscores_in_headers on;
…
}
server {
listen 80;
…
}
Maxim D.