Skip to content

Commit e90f3a4

Browse files
authored
Update nginx.conf.template
1 parent 1ad03e9 commit e90f3a4

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

nginx.conf.template

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,13 @@ http {
2525
server_name ${SERVER_NAME};
2626

2727
location / {
28-
29-
# Check if CF-Connecting-IP exists and set X-Forwarded-For accordingly
30-
set $real_ip $remote_addr;
31-
if ($http_cf_connecting_ip) {
32-
# Override if Cloudflare header is present
33-
set $real_ip $http_cf_connecting_ip;
34-
}
35-
36-
# Set headers for proxying
37-
proxy_set_header X-Real-IP $real_ip;
38-
proxy_set_header X-Forwarded-For $real_ip;
28+
proxy_set_header X-Real-IP $client_ip;
29+
proxy_set_header X-Forwarded-For $client_ip;
3930

4031
proxy_set_header Host $host;
4132
proxy_set_header Connection $http_connection;
4233

4334
proxy_pass http://${BACKEND_HOST}:${BACKEND_PORT};
4435
}
4536
}
46-
}
37+
}

0 commit comments

Comments
 (0)