在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java  Linux/ 如圖,nginx的server_name并沒有配置的域名為什么也能轉(zhuǎn)發(fā)?

如圖,nginx的server_name并沒有配置的域名為什么也能轉(zhuǎn)發(fā)?

server_name只是配置了e-house.cn www.e-house.cn
為什么輸入louqibang.com的時候,也一樣會轉(zhuǎn)發(fā)到ehouse這個項目?
圖片描述

回答
編輯回答
悶騷型

這個問題在nginx文檔中可以找到原因

If a server is the only server for a listen port, then nginx will not test server names at all (and will not build the hash tables for the listen port). However, there is one exception. If a server name is a regular expression with captures, then nginx has to execute the expression to get the captures.

也就是說,如果某個端口下只有一個server_name的時候,所有訪問該端口的請求,不管server_name是什么,都會由該server塊處理。

請看 Server Names。

2017年2月14日 16:15