1. Set up LAN server

If the default port is disabled, you can change the port number in D:\nginx-1.13.7\conf\nginx.conf: Nginx.

Find the following fields in nginx.conf:

 server {

listen 80;

server_name localhost;



#charset koi8-r;



#access_log logs/host.access.log main;



location / {

root D:/nginx-1.13.7\nginx-1.13.7\html;

index index.html index.htm;

}

The number 80 behind listen is the set Intranet port number. If it is disabled by default, you can set it yourself. Take the number between 8000-20000, for example, set it to 8888. http://localhost:8888, the Welcome to Nginx page is displayed, indicating that the configuration is successful

You can create your own.html file in the HTML folder of Nginx, for example, create a file named test.html, assuming the local IP address is 192.168.0.102, In any network devices in a network type http://192.168.0.102:8888/test.html can see your new test. The HTML page

The LAN web server is set up successfully

2. Map the Extranet to establish a network server

Into the router Settings interface, TP – the Link of the router, for example, to view the IP address of the router to display on the network, and then in the baidu search IP, the IP address of the two display is consistent, find the virtual server or port forwarding in the router interface function, and then point to add, fill in the set before good internal port and the LAN IP address of the unit, Then set up an external port, legend

Assume that the network IP address is 119.166.167.120, enter http://119.166.167.120:8088/test.html in network devices

You can access the HTML page created before, so the mapping extranet set up successfully

By registering an account on the DDNS of a router, you can create a fixed domain name of your own. In this way, the computer can change its location and external devices can log in to the router using the fixed domain name.