August 2017
Intermediate to advanced
278 pages
8h 53m
English
To start with, we need to define our new log format:
log_format vhostlogs '$host $remote_addr - $remote_user '
'[$time_local] "$request" $status '
'$body_bytes_sent "$http_referer" '
'"$http_user_agent"';
To use our new log file, we update the access log format in the server block with the new format. Here's an example with our MediaWiki recipe:
access_log /var/log/nginx/mediawiki-vhost-access.log vhostlogs;
If you had a wildcard setup for your subdomains, this would mean that you'd also have the correct hostname in the logs as well. Without this, the logs wouldn't be able to differentiate between any of the subdomains for statistical analysis and comparison. ...
Read now
Unlock full access