Reloading config with differently cased proxy_set_header field name does not change field name in proxied request
|Reported by:||Oliver Friedrich||Owned by:|
|uname -a:||Linux o071.orange.fastwebserver.de 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux|
|nginx -V:||nginx version: nginx/1.5.2|
Today, I was pulling my hair out because I wanted to change my wrong X-Forwarded-For configuration from
proxy_set_header X_FORWARDED_FOR $proxy_add_x_forwarded_for;
to the correct version
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
I tried reloading the config using
service nginx relaod a few times but without success.
The solution that finally worked was to comment the above line completely, reload the configuration, uncomment the corrected version and reload again. Now, the rewritten requests contain the X-Forwarded-For header instead of the wrong X_FORWARDED_FOR one.
Since I don't know nginx's source I cannot tell what scope this problem has - it might be a larger problem, altogether.