Skip to content

Commit

Permalink
Append to X-Forwarded-For header (#2073)
Browse files Browse the repository at this point in the history
* OpenRESTY proxy append to X-Forwarded-For header instead of overwriting it
* related to dashboard metrics issue - flare #44.
  • Loading branch information
csjiang committed Nov 16, 2021
1 parent b0d44f2 commit fef798c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions discovery-provider/nginx_conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ http {
location ~* ^/.*_check/?$ {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location = /version {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /v1/metrics {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location / {
Expand Down Expand Up @@ -100,7 +100,7 @@ http {

proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}

0 comments on commit fef798c

Please sign in to comment.