“configuration file /etc/nginx/nginx.conf test failed”: How do I know why this happened?

前端 未结 4 2090

I\'m an nginx noob trying out this this tutorial on nginx 1.1.19 on ubuntu 12.04. I have this nginx config file.

When I run this command the test fails:

         


        
相关标签:
4条回答
  • 2021-01-31 01:29

    This particular commands worked for me. sudo apt-get remove --purge nginx nginx-full nginx-common

    and sudo apt-get install nginx

    credit to this answer on stackexchnage

    0 讨论(0)
  • 2021-01-31 01:39

    sudo nginx -t should test all files and return errors and warnings locations

    0 讨论(0)
  • 2021-01-31 01:39

    Show file and track error

     systemctl status nginx.service
    
    0 讨论(0)
  • 2021-01-31 01:40

    If you want to check syntax error for any nginx files, you can use the -c option.

    [root@server ~]# sudo nginx -t -c /etc/nginx/my-server.conf
    nginx: the configuration file /etc/nginx/my-server.conf syntax is ok
    nginx: configuration file /etc/nginx/my-server.conf test is successful
    [root@server ~]# 
    
    0 讨论(0)
提交回复
热议问题