There are two ip, in the server that use nginx to set up a station. How to specify a different ip? for each domain name setting?

now I can find the corresponding ip, when I resolve different ip, speed tests for domain names directly in dns. Can I just resolve domain names and specify what ip, doesn"t need to be set ?

after I set ip in the current site profile include / www/server/panel/vhost/nginx/ domain name .conf;
listen, the site will be 404.

server
{
    listen XX.XXX.80.104:80;
    *************************
    *************************

A few years ago, someone asked
nginx listen to specify IP:80 and not specify to listen for all port 80 requests. The former accesses normally and the latter accesses 404. Why? -SegmentFault want to https://codeshelper.com/q/10.


  1. first notice the cache of DNS. For example, if you are connected to the Internet, the native DNS recommends using Ali's public DNS.
  2. if it is diverted directly at the DNS level, the request should not reach the Ngx you have set. For example, you have two ip, 10.0.0.1 and 10.0.0.2 . If you set the former to www.a.com and the latter to www.b.com , then the request of www.b.com will not reach 10.0.0.1 .
  3. if you want to divert streams to a certain ip, you should parse them all to this ip, and then use server_name or reverse proxy to different application services on Ngx
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9fb50-1a78.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9fb50-1a78.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?