virtualmin/virtualmin-nginx

Unable to configure logging template for new sites

Opened this issue · 0 comments

There is a bit of a problem with the current template options for new Nginx sites which prevents the logging of remote IP addresses from behind a proxy.

Nginx has a default 'combined' log format. This cannot be overriden or changed. In order to alter the logging format to include a remote IP address from behind a proxy, a new log format needs to be created, and this format needs to be specified on the access_log directive.

Currently, Virtualmin appears to pull the access_log file name from the Apache template, but ignores the optional log format. It creates all new sites with an access_log directive without a log format option, which means that the default Nginx format is used.

This means that at the moment, it's not possible to correct the log format and provide the remote IP address by using a nominated log format in the site template.