This article only serves as a record to avoid the time-consuming problems of later encountering such issues.
Actual situation: The company has a fixed telecommunications broadband is fixed IP, want to map the fixed IP to the test environment IP, the realization can be public network through fixed IP access, intranet through the LAN IP access.
The test environment service is occupied by 80 ports and 8080 ports.
Main steps: Router IP mapping----"Access-----" Check problem-------"Change the listening port
First step: Router IP mapping
The first step is so simple. In your router setup OK
Step Two: Access
Now that we're done mapping, we'll look directly through the public IP access. (Special note: do not let the computer already in the intranet by opening the public IP access , this is not effective, you can see that you can access, but if you use an extranet computer to access the fixed IP, you will find no access)
Here we do not have direct access to the way we test directly with Telnet.
[[Email protected] ~]# Telnet212.13.141.240 theTrying212.13.141.240...^C[[email protected]~]#telnet 212.13.141.240 A Trying 212.13.141.240... Connected to212.13.141.240. Escape character is'^]'. SSH-2.0-openssh_7.4^]telnet>Qconnection closed. [[Email protected]~]# Telnet212.13.141.240 8080Trying218.17.141.240...^c
You will find that one of our very strange phenomena is that port 22 can be telnet. The other ports are non-pass.
Step three: Check for problems
We checked that ports 80 and 8080 were listening, and that the firewalls were open to both ports. We have found that telecom operators are blocking some of the commonly used 80.8080 ports directly.
Fourth step: Change the Listening port
Because we have to ensure that the internal network can access, but also to ensure that the external network can be directly accessed. We use Nginx to monitor two ports. 80 port is direct LAN access, 6666 port for public network access. That's it.
The following is attached to the Nginx configuration.
server { listen ; Listen 6666; server_name amz.test.com; Location/{ try_files $uri/index.html; Root/usr/local/amazonhelpfront/source/dist;} Location ^~/api/{ proxy_pass http://127.0.0.1:8081; Proxy_set_header x-forward-for $remote _addr; } }
Telecom fixed IP Broadband 80 and 8080-port stepping pits