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

后端 未结 9 1149
慢半拍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.

    0 讨论(0)
  • 2020-11-30 16:58

    Type this command in the terminal:

    sudo cat /var/log/nginx/error.log
    
    0 讨论(0)
  • 2020-11-30 17:00

    Errors are stored in the nginx log file. You can specify it in the root of the nginx configuration file:

    error_log  /var/log/nginx/nginx_error.log  warn;
    

    On Mac OS X with Homebrew, the log file was found by default at the following location:

    /usr/local/var/log/nginx
    
    0 讨论(0)
提交回复
热议问题