原文:linux之"server" directive is not allowed here in

配置完rewrite之后重啟nginx發現如下錯誤 server directive is not allowed here in 原因是因為 外部配置的simple.conf沒有include到nginx.conf的http 里面 修改nginx.conf之后解決 ...

2015-04-16 11:01 0 6035 推薦指數:

查看詳情

nginx服務運行失敗nginx: [emerg] "server" directive is not allowed here

下午一台阿里雲服務器上的Nginx突然停止運行,服務失敗。 journalctl -xe查看具體的報錯信息其中有顯示,但是沒有顯示是具體那個nginx的配置文件有問題 然后更進一步查看nginx的error日志 應該會有具體的顯示報錯位置 cat /www/server ...

Fri Aug 20 22:16:00 CST 2021 0 564
nginx: [emerg] "upstream" directive is not allowed here in .../.../.../*.conf

因為臨時需要在本機搭建一個nginx服務使用,其實很簡單的一個本地server,但是運行的時候就報錯: 檢查了我的配置文件 test.com.conf 發現也沒有問題: 然后網上查了一下說是“upstream”不能再http這個block里面,於是查看了一下 ...

Sun Mar 01 08:56:00 CST 2020 0 6053
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM