search

Home  >  Q&A  >  body text

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?

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?

曾经蜡笔没有小新曾经蜡笔没有小新2755 days ago755

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-16 17:22:25

    Yes, if you specify server_name correctly.

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

    reply
    0
  • Cancelreply