Created
May 11, 2015 10:16
-
-
Save jorisros/4fa6c5478ad2bb029a75 to your computer and use it in GitHub Desktop.
example vhost config for logging acces after a nginx proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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