library

technical documents

Lighttpd behind a proxy

Posted by: Dan on July 29, 2007 01:32:26 PM +00:00
If your website is behind a reverse-proxy, you'll want to log the visitor's IP, not the proxy's.

If you're running your lighttpd on a high-numbered port (>1023), then you're probably behind a reverse-proxy. In this case, lighttpd's log by default picks up the proxy's ip address, not the end-user's. In order to capture this information for all of your access logs, place the following line in the global context of your lighttpd.conf:

accesslog.format = "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""

For more information on what these options mean and additional options for logging, check out lighty's wiki.

Updated: 05 Apr 10 07:32