Skip to content

Instantly share code, notes, and snippets.

@jorisros
Created May 11, 2015 10:16
Show Gist options
  • Select an option

  • Save jorisros/4fa6c5478ad2bb029a75 to your computer and use it in GitHub Desktop.

Select an option

Save jorisros/4fa6c5478ad2bb029a75 to your computer and use it in GitHub Desktop.
example vhost config for logging acces after a nginx proxy
<VirtualHost *:80>
#domain settings
DocumentRoot /home/user/sites/domain.net/public_html
ServerName domain.net
ServerAlias www.domain.net
#Setting the log format and location of the files
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 "/var/log/httpd/www.domain.net-access.log" combined env=!forwarded
CustomLog "/var/log/httpd/www.domain.net-access.log" proxy env=forwarded
ErrorLog /var/log/httpd/www.domain.net-error.log
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment