Moving from apache2 to nginx

If you want to use nginx as a reverse proxy, be aware that the default log format is not the same as apache’s default combined log, so it might screw up any log analyzers (like awstats), which will show the incorrect log entries as corrupted records.

If you were not aware of this, use the following sed command:

cat FUBAR.log | sed -e ‘s/(.* – – [.*]) (.* .* .*) “(.*)” (.* “.*” “.*”) “.*”/1 “2” 3 4/’ > /tmp/not-FUBAR.log

Leave a Reply

Your email address will not be published. Required fields are marked *