CentOS伺服器下Nginx未啟動的解決方案

來源:互聯網
上載者:User

CentOS伺服器下Nginx未啟動的解決方案
問題一:

  1. nginx:[emerg]hostnotfoundinupstream“11.lum”in/usr/local/nginx/conf/vhost.conf:116
  2. Nginx啟動成功!Nginxwasstartedsuccessfully.

上面錯誤為nginx未啟動,點啟動時提示上面語句。
類似這告訴的錯誤,解決方案

點左側 網站(虛擬機器主機) => 編輯 任何一個網站 => 不用改什麼 直接儲存 => 在去啟動nginx 啟動成功後 在去編輯任何一個網站,不用改什麼直接儲存 => ok

問題二:如果重啟伺服器後,Nginx為啟動,在後台手動啟動Nginx報下面的錯誤

  1. Shuttingdownphp_fpmStartingphp_fpmdonenginx:[emerg]couldnotbuildtheserver_names_hash,youshouldincreaseeitherserver_names_hash_max_size:512orserver_names_hash_bucket_size:128nginx:[emerg]couldnotbuildtheserver_names_hash,youshouldincreaseeitherserver_names_hash_max_size:512orserver_names_hash_bucket_size:128
  2. Nginx重啟失敗!Nginxwasrestartedfailed.

解決方案,登入ssh,把/usr/local/nginx/conf/nginx.conf 檔案裡這一行的數值修改下

原來的是:server_names_hash_bucket_size 128;改成:server_names_hash_bucket_size 512;

如果自己手工修改過網站偽靜態,這塊也檢查下,有的時候也可能是網站偽靜態問題,刪除之前的偽靜態在啟動,也可以解決問題。


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.