Hi all.
I have nginx proxy for iis 7 server, but when I addressing to iis server I have a 400 Bad Request Invalid Hostname error periodically (when I press F5). So I saw the nginx and the iis logs and saw that my queries which have a 400 error code does not reach the IIS server.
I tried several configs:
location / {
proxy_set_header x-real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://localhost:80;
}
....
location / {
proxy_pass http://localhost:81;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
port_in_redirect off;
proxy_connect_timeout 300;
}
...
location / {
proxy_pass http://localhost:81;
proxy_set_header Host $host;
proxy_set_header X-Accel-Expires 0;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Please help find the possible causes of this behavior
I have nginx proxy for iis 7 server, but when I addressing to iis server I have a 400 Bad Request Invalid Hostname error periodically (when I press F5). So I saw the nginx and the iis logs and saw that my queries which have a 400 error code does not reach the IIS server.
I tried several configs:
location / {
proxy_set_header x-real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://localhost:80;
}
....
location / {
proxy_pass http://localhost:81;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
port_in_redirect off;
proxy_connect_timeout 300;
}
...
location / {
proxy_pass http://localhost:81;
proxy_set_header Host $host;
proxy_set_header X-Accel-Expires 0;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Please help find the possible causes of this behavior