我试图mod_remoteip
在单独的服务器中使用代理鱿鱼在 apache2.4 中进行配置,但 access.log 中的 IP 仍然是代理的 IP。我使用这个https://trick77.com/apache2-2-4-logging-remote-ip-address-using-mod_remoteip/
事实上,我已经发现,在/etc/apache2/apache2.conf
命令中
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
Run Code Online (Sandbox Code Playgroud)
access.log
即使我更改文本或删除它,也不要更改格式。
有人可以帮忙吗?
我发现使用昵称combined
不起作用,因为它已经被占用了。所以这有效:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" %D"
myawesomeformat
CustomLog ${APACHE_LOG_DIR}/access.log
myawesomeformat
归档时间: |
|
查看次数: |
3785 次 |
最近记录: |