Added the ability to see Real IPs if Nginx is running under another proxy (such as Traefik).

This commit is contained in:
Alex Jarmoszuk
2020-10-06 10:51:10 +02:00
parent 2e0a8307d1
commit fb1a0182e2
4 changed files with 19 additions and 1 deletions

View File

@@ -62,7 +62,8 @@ http {
server_tokens %SERVER_TOKENS%;
# write logs to local syslogd
access_log syslog:server=unix:/dev/log,nohostname,facility=local0 combined;
%PROXY_REAL_IP%
access_log syslog:server=unix:/dev/log,nohostname,facility=local0 %LOG_TYPE%;
error_log syslog:server=unix:/dev/log,nohostname,facility=local0,severity=warn;
# lua path

3
confs/proxy-real-ip.conf Normal file
View File

@@ -0,0 +1,3 @@
log_format proxy '$http_x_real_ip - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';