I have the following in config file
server {
listen 80;
server_name _;
access_log /var/log/nginx/access.log main;
...
server {
listen 80;
server_name example.com
access_log off;
error_log off;
But it is still keep logging for example.com
virtual host. What am I doing wrong?
Best Answer
You are missing
;
after server_name directive.access_log
andoff
are being treated as additional server_names.