centos7 - nginx configuration access_log problem
为情所困
为情所困 2017-05-27 17:44:58
0
1
849

I want to enable access logs for nginx. Baidu took a look, mainly configuring

in nginx.conf

This section

#    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                      '$status $body_bytes_sent "$http_referer" '
#                      '"$http_user_agent" "$http_x_forwarded_for"';
#
#    access_log  logs/access.log  main;

is commented out with # by default. I want to turn it on, that is, uncomment this section with #.
Then restart nginx but it cannot be restarted, prompting
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

It’s fine after adding # back. What’s the reason?
Including the error log at the beginning

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

I also removed the # to take effect, but nginx could not start.
`

为情所困
为情所困

reply all(1)
刘奇

1. Please use nginx -t to check the configuration file to view the specific error information

The log is processed like this

   log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                     '$status $body_bytes_sent "$http_referer" '
                     '"$http_user_agent" "$http_x_forwarded_for"';

   access_log  logs/access.log  main;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!