fixed handling of X-Forwarded-For, removed X-Real-IP stuff
This commit is contained in:
parent
f01cca999f
commit
ca543dcb5b
|
@ -18,8 +18,9 @@ server {
|
|||
location / {
|
||||
client_max_body_size $body_size;
|
||||
client_body_timeout 300s;
|
||||
proxy_set_header X-Real-IP $$remote_addr;
|
||||
proxy_set_header X-Forwarded-For $$remote_addr;
|
||||
if ($$http_x_forwarded_for = "") {
|
||||
add_header X-Forwarded-For $$remote_addr;
|
||||
}
|
||||
proxy_set_header Host $$host;
|
||||
proxy_pass http://$ip:$port/;
|
||||
}
|
||||
|
@ -36,8 +37,9 @@ server {
|
|||
location /$location {
|
||||
client_max_body_size $body_size;
|
||||
client_body_timeout 300s;
|
||||
proxy_set_header X-Real-IP $$remote_addr;
|
||||
proxy_set_header X-Forwarded-For $$remote_addr;
|
||||
if ($$http_x_forwarded_for = "") {
|
||||
add_header X-Forwarded-For $$remote_addr;
|
||||
}
|
||||
proxy_set_header Host $$host;
|
||||
proxy_pass http://$ip:$port/;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue