Home  >  Q&A  >  body text

nginx - How to access the intranet through the router's port mapping function

There are several servers under the fixed IP of the public network (220.174.XX.XX). These servers are connected to the network through the router. One of the server IP (192.168.0.220) is used as the intranet WEB server and runs nginx. There are two websites on this server. The port mapping of these two websites is currently set up on the router like this:

The nginx running on this server listens to port 80, and the external port is 8888. Then through the settings in DNSPOD, you can access this through the domain name:
http://files.XXXX.com:8888/ page

Part of the configuration of files.xxxx.com.conf on nginx is as follows:

Now comes the problem, the configuration part of the second website web.xxxx.com.conf:

server{
listen 80;
server_name web.xxxx.com;
...

Routing port mapping configuration:

Then I also made similar A record parsing settings in DNSPOD, but I still cannot access http://web. xxxx.com:8080

How should I configure it?

巴扎黑巴扎黑2714 days ago1130

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 17:10:59

    The configuration seems to be fine, but I’m not sure what the reason is. However, since the domain names are different, you can also use port 8888 to access them. http://web.xxxx.com:8888. Also, I don’t know if you restarted Nginx after modifying the configuration.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 17:10:59

    There are many possibilities. First, make sure web.xxxx.com can be accessed via port 80 on the intranet.

    In addition, although it is said to be a fixed IP on the public network, some operators may still block ports 80, 443, 8080 and other ports. Change to a high-end port and test it first.

    Some routers may not work properly. Try to access the external network instead of accessing the external IP+ port from the internal network.

    reply
    0
  • Cancelreply