Skip to content

Commit 439e7e5

Browse files
committed
httpd config: Add X-Forwarded-For to our LogFormat
For debugging and security response, we need to be able to know the original requestor's IP, not just the Traefik IP handling the request. This adds the content of the X-Forwarded-For header to the combined LogFormat, which is what we pipe out. If there is no content, Apache will log a "-"; there is no impact to images that directly face the Internet without being behind a proxy.
1 parent 37a499d commit 439e7e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/etc/httpd/conf/httpd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ LogLevel warn
189189
# The following directives define some format nicknames for use with
190190
# a CustomLog directive (see below).
191191
#
192-
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
192+
LogFormat "%h (for %{X-Forwarded-For}i) %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
193193
LogFormat "%h %l %u %t \"%r\" %>s %b" common
194194

195195
<IfModule logio_module>

0 commit comments

Comments
 (0)