The existing domain name test.com purchased from
Wanwang has been resolved to ip
and is 192.168.2.106
Alibaba Cloud linux
server On the server, the directory path is A
, and the server is also configured with the hosts
file.
hosts
127.0.0.1 test.com
Now there is a need to access another website on the server 192.168.2.106
through IP (linux local domain name is csp.com
), and the target directory is B
, and does not affect the normal use of the test.com
website, the hosts
configuration file is as follows:
192.168.2.106 csp.com
The result is that using ip
to access the csp.com
website in the directory B
, using the domain name test.com
When I visit, I also visit the website csp.com
with the directory B
, which is frustrating.
How to implement, ip
access, access the csp.com
website in the directory B
, use the domain name test.com
to access , are you accessing the website test.com
with the directory A
? ?
If you have configured domain name resolution, the configuration of hosts, especially the hosts configuration on the server is redundant
The simplest solution is to use two vhosts
nginx’s plan is as follows
For details, please see: https://www.nginx.com/resource...