Intranet program configuration extranet access plan

This solution can solve the problem that the client company does not have a fixed IP, and the internal network IIS program configures external network access. If you have a fixed IP, you can directly map the port on the company's main router.

1. Apply for a company domain name and cloud server

2. Under the applied company's first-level domain name, resolve a second-level domain name, and use the pan-domain name method to resolve to the cloud server ip

3. Configure frp on the cloud server and the local application server to achieve intranet penetration

1. On the cloud server:

[common]

bind_port = 7000

run start.bat

2. On the local application server:

[common]

server_addr = 117.50.*.* ------ cloud server IP

server_port = 7000

token = xxxxxxxx

[appa] ---- can not duplicate the name

type = tcp

local_ip = 127.0.0.1

local_port = 6090 --- open a port on the local server, need to open the firewall

remote_port = 6091 ---- port connected to the cloud server, internal network port

To run start.bat, you need to set the agent to start automatically at boot

4. Configure nginx proxy on the cloud server

server {

    listen      6090;

    server_name localhost;

    proxy_set_header Host $host;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_set_header REMOTE-HOST $remote_addr;

    root        html;   

    location / { 

        proxy_pass http://127.0.0.1:6091 ; ----Connect to port 6090 on the local server

        client_max_body_size 200m;

        proxy_connect_timeout    600s;

        proxy_read_timeout       600s;

        proxy_send_timeout       600s;

    }

    location /error {

   }

    location ~ /\.ht {

        deny  all;

    }

    location ~ /.+\.(inc|conf|cnf) {

        deny  all;

    }

     #access_log off

}

Restart the nginx proxy service

5. Configure IIS on the local application server. The IIS configuration uses the second-level domain name resolved in the second step and the development port on the local application server set in the third step.

For example:

 The result of the operation is as follows:

Guess you like

Origin blog.csdn.net/qq1507171150/article/details/131109299