I wanted to test the front-end project locally, so I built a development environment through the nginx server, but encountered a problem when I changed the nginx.conf configuration to server. The server configuration of
nginx is: listen:8020;server_name:m.hostname.com;location / {
root: /usr/local/var/www/itemname;
index: index.html
}
the problem is that I wrote in the system hosts file: 192.168.0.111ip 8020 (the ip address of my computer) m.hostname.com (also this domain name online)
but accessing m.hostname.com through the browser will not access my local front-end projects, but access online projects, but through 192.168.0.111 ip 8020 can access my local front-end projects, this is why?