nginx: [emerg] “server” directive is not allowed here

前端 未结 4 1343
暖寄归人
暖寄归人 2020-11-29 20:52

I have reconfigured nginx but i can\'t get it to restart using the following config:

conf:

server {
listen 80;
server_name www.example.com;
return 30         


        
4条回答
  •  一个人的身影
    2020-11-29 21:24

    There might be just a typo anywhere inside a file imported by the config. For example, I made a typo deep inside my config file:

    loccation /sense/movies/ {
                      mp4;
            }
    

    (loccation instead of location), and this causes the error:

    nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/xxx.xx:1
    

提交回复
热议问题