Web Server di belakang proxy dan LogFormat

Web server di belakang proxy dan LogFormat

Saat web server apache berada di belakang proxy dan memakai konfigurasi httpd.conf yang standar, pada berkas access_log akan mencatat IP address proxy. Agar access_log mencatat IP pengakses harus melakukan pengaturan melalui LogFormat:

LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” combined

LogFormat “%{X-Forwarded-For}i %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” proxy

SetEnvIf X-Forwarded-For “^.*\..*\..*\..*” forwarded
CustomLog “logs/access_log” combined env=!forwarded
CustomLog “logs/access_log” proxy env=forwarded

You can leave a response, or trackback from your own site.

Leave a Reply