Where can I find the error logs of nginx, using FastCGI and Django?

后端 未结 9 1213
慢半拍i
慢半拍i 2020-11-30 16:02

I\'m using Django with FastCGI + nginx. Where are the logs (errors) stored in this case?

9条回答
  •  囚心锁ツ
    2020-11-30 16:58

    My ngninx logs are located here:

    /usr/local/var/log/nginx/*
    

    You can also check your nginx.conf to see if you have any directives dumping to custom log.

    run nginx -t to locate your nginx.conf.

    # in ngingx.conf
    error_log  /usr/local/var/log/nginx/error.log;
    error_log  /usr/local/var/log/nginx/error.log  notice;
    error_log  /usr/local/var/log/nginx/error.log  info;
    

    Nginx is usually set up in /usr/local or /etc/. The server could be configured to dump logs to /var/log as well.

    If you have an alternate location for your nginx install and all else fails, you could use the find command to locate your file of choice.

    find /usr/ -path "*/nginx/*" -type f -name '*.log', where /usr/ is the folder you wish to start searching from.

提交回复
热议问题