nginx listen specifies IP:80 and does not specify to listen to all 80 port requests. The former accesses normally and the latter accesses 404. Why is this?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 17:20:25
0
1
733

My server is configured with multiple IPs, but since there are many sites on it, there will be multiple sites that need to use the same IP.
In the past, the configuration of the site would directly listen to the specific IP: 80 in the server segment;
Now there is a new site that needs to bundle multiple domain names, and each domain name is resolved to a different IP on this server. So in Listen, all ports 80 are directly monitored without specifying an IP. As a result, a 404 prompt from nginx appears when accessing.
When the server receives a port 80 request, won't it traverse all configuration files to see if there is a configuration file for this domain name?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
世界只因有你

Yes, if you specify server_name correctly.

If you want to find out the truth, please post your complete configuration.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!