Access the Web service of the intranet through a custom domain name

By using a simple Configuration HTTP type Agent, you can enable users to access The Web service of the intranet through a custom domain name.

HTTP type agents are very suitable for integrating the web of internal networks Services are provided to external users through custom domain names. Compared to TCP type Agent, HTTP Agents not only reuse ports, but also provide many functions based on the HTTP protocol.

HTTPS is similar to this, but it should be noted that the HTTPS Agent for frp The local service needs to be an HTTPS service, and the FRPS end will not perform TLS termination. It can also be combined with Implementing HTTPS to convert local HTTP services The agreement was exposed.

Steps

  1. Configuration frps.toml

    Add the following to the frps.toml file to specify HTTP. The listening port for the request is 8080:

    bindPort = 7000
          vhostHTTPPort = 8080
          

    If you need Configuration HTTPS Agent, you also need to set the vhostHTTPSPort

  2. Configuration frpc.toml

    Add the following to the frpc.toml file to ensure that the correct server IP is set. Address, local Web service listening port and custom domain name:

    serverAddr = "x.x.x.x"
          serverPort = 7000
          
          [[proxies]]
          name = "web"
          type = "http"
          localPort = 80
          customDomains = ["www.yourdomain.com"]
          
          [[proxies]]
          name = "web2"
          type = "http"
          localPort = 8080
          customDomains = ["www.yourdomain2.com"]
          
  3. Start FRPS and FRPC

  4. Domain name resolution

    Connectwww.yourdomain. comand Domain name A forwww.yourdomain2. com Record the IP address resolved to the server x.x.x.x. If the server already has a corresponding domain name, you can also add CNAME Record resolution to the original domain name. Additionally, by modifying the Host of HTTP requests Fields can also achieve the same effect.

  5. Accessing through a browser

    Use browser access http://www.yourdomain.com:8080 You can access the 80 port service on the internal network machine to access http://www.yourdomain2.com:8080 You can access the 8080 port service on the internal network machine.

Last modified November 15, 2023: fix 404 (#71) (626ce4d)