日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

Nginx could not build the server

發(fā)布時間:2025/4/16 Nginx 98 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Nginx could not build the server 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

這篇文章主要介紹了Nginx could not build the server_names_hash 錯誤的解決辦法,需要的朋友可以參考下
在給nginx 配置了一個超長的域名后,通過 /usr/local/nginx/sbin/ngnix -t 檢查配置文件時出現(xiàn)一下錯誤:
復(fù)制代碼 代碼如下:could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
解決辦法是在nginx的配置文件的http段中增加如下配置:
復(fù)制代碼 代碼如下:server_names_hash_bucket_size 64;
如果已經(jīng)存在,需要加大后面的數(shù)值,注意:該數(shù)值是32的倍數(shù)為宜。
下面是nginx官方文檔:
復(fù)制代碼 代碼如下:如果定義了大量名字,或者定義了非常長的名字,那可能需要在http配置塊中使用server_names_hash_max_size和server_names_hash_bucket_size指令進(jìn)行調(diào)整。server_names_hash_bucket_size的默認(rèn)值可能是32,或者是64,或者是其他值,取決于CPU的緩存行的長度。如果這個值是32,那么定義“too.long.server.name.example.org”作為虛擬主機(jī)名就會失敗,而nginx顯示下面錯誤信息:嬰兒起名

could not build the server_names_hash,
you should increase server_names_hash_bucket_size: 32
出現(xiàn)了這種情況,那就需要將指令的值擴(kuò)大一倍:

http {
server_names_hash_bucket_size 64;

如果定義了大量名字,得到了另外一個錯誤:

could not build the server_names_hash,
you should increase either server_names_hash_max_size: 512
or server_names_hash_bucket_size: 32
那么應(yīng)該先嘗試設(shè)置server_names_hash_max_size的值差不多等于名字列表的名字總量。如果還不能解決問題,或者服務(wù)器啟動非常緩慢,再嘗試提高server_names_hash_bucket_size的值。

總結(jié)

以上是生活随笔為你收集整理的Nginx could not build the server的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。