Fresh install of CentOS 7 and nginx 1.6.3. Per the official documentation I set the access_log directive to forward via syslog to a remote server in /etc/nginx/nginx.conf:
#access_log /var/log/nginx/access.log main; access_log syslog:server=[10.1.2.3],facility=local7,tag=nginx,severity=info;
When I restart (or start) nginx with that change, I get the following error:
[root@localhost ~]# systemctl restart nginx Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. [root@localhost ~]# systemctl status nginx.service (...) nginx: [emerg] open() "/usr/share/nginx/syslog:server=[10.1.2.3],facility=local7,tag=nginx,severity=info" failed (13: Permission denied) (...)
It's like the service doesn't know how to parse its own config file correctly, as if the IP and options are part of a file it's trying to read from. Anyone get this working, am I missing something obvious?