How to Expose Intranet Web Services with Custom Domains Using frp
This guide explains what frp is, why it’s a strong reverse‑proxy choice, and provides step‑by‑step instructions—including configuration files, port opening, and domain setup—to expose internal web services through custom domains securely.
Overview
What is frp?
frp is a high‑performance reverse‑proxy for intranet penetration. It supports TCP, UDP, HTTP, HTTPS and provides P2P communication, allowing internal services to be exposed through a node with a public IP.
Architecture
GitHub repository: https://github.com/fatedier/frp
Key Features
Multiple protocol support: TCP, QUIC, KCP, Websocket, etc.
TCP connection multiplexing to reduce latency.
Load balancing across proxy groups.
Port reuse for exposing many services via one server port.
P2P communication to bypass the server when possible.
Client plugins such as static file viewer, HTTP/HTTPS conversion, SOCKS5.
Extensible server plugin system.
User‑friendly UI for configuration and monitoring.
Installation
App Store (optional)
Version: v0.54.0
Configure HTTP proxy with a custom domain
Use an HTTP‑type proxy to expose an internal web service via a custom domain. The HTTP proxy reuses a port and provides HTTP‑specific features. HTTPS works similarly but requires the backend service to be HTTPS or the use of the https2http plugin.
Steps
1. Configure frps.toml
Add the following to frps.toml to set the HTTP request listening port to 8484.
File:
/opt/1panel/apps/frps/frps/data/frps.toml bindPort = 7000
vhostHTTPPort = 8484
# To enable HTTPS proxy also set vhostHTTPSPort2. Open required ports
On the server (e.g., Alibaba Cloud) open the following ports in the security group: 7000 – client‑server communication 8484 – HTTP proxy listening port 7500 – frp dashboard
3. Configure frpc.toml
The client version must match the server version. Example uses frp_0.54.0_windows_amd64 .
File:
frpc.toml serverAddr = "x.x.x.x"
serverPort = 7000
[[proxies]]
name = "web"
type = "http"
localPort = 8782
customDomains = ["webman2024.tinywan.com"] serverAddris the public IP of the frps server.
4. Start the local web service
php start.php start
# Workerman output shows the service listening on http://0.0.0.0:8782Ensure the service is reachable at http://127.0.0.1:8782 .
5. Start frps and frpc
Server (frps)
Client (frpc)
cd /d/frp_0.54.0_windows_amd64
./frpc.exe -c frpc.toml
# Expected log:
# [I] start frpc service for config file [frpc.toml]
# [I] try to connect to server...
# [I] login to server success, get run id [...]
# [I] proxy added: [web]
# [I] start proxy success6. Domain resolution
Create an A record for webman2024.tinywan.com pointing to the server’s public IP (x.x.x.x). If the server already has a domain, a CNAME record or Host header modification can be used.
7. Access the service
Open http://webman2024.tinywan.com:8484 in a browser. The request is forwarded to the internal service listening on port 8782.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
