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?
Yes, if you specify
server_name
correctly.If you want to find out the truth, please post your complete configuration.