Skip to content

Commit

Permalink
fix: use remote_addr instead of user-defined header ip
Browse files Browse the repository at this point in the history
$proxy_add_x_forwarded_for sets the user defined ip in the request.
changing it to $remote_addr ensures that nginx sets the remote ip
itself, disregarding user-specified ip from the request.

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
  • Loading branch information
Thunderbottom committed Jun 11, 2020
1 parent 5e0de6f commit a6bb587
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bench/config/templates/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ server {
}

location @webserver {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frappe-Site-Name {{ site_name }};
proxy_set_header Host $host;
Expand Down

0 comments on commit a6bb587

Please sign in to comment.