Set up intranet penetration using frp with a full Docker deployment. Tested the speed, and it’s pretty good with acceptable latency.
DNS Configuration
You’ll need a server with a public IP. I handle my SSL certificates via Cloudflare, so all my connections go through port 80.
Configure a few domains pointing to your server: one for connecting to frp (e.g., frp.example.com), and others for the services you want to proxy (e.g., server1.example.com, server2.example.com). Note that the frp connection domain (frp.example.com) must not use Cloudflare proxying—keep it on “DNS only” mode.
Server Side
Setting up frp on the server is pretty straightforward. Prepare the config file frps.toml:
| |
Set a secure token, then create the docker-compose.yml:
| |
Spin it up:
| |
Nginx Configuration
Reverse proxy the frp connection domain (frp.example.com) to bindPort = 7000 (which is 172.17.0.1:7000).
Then, reverse proxy all service domains to vhostHTTPPort = 8000 (which is 172.17.0.1:8000).
Since Cloudflare proxying is enabled, you can’t just bundle these domains under a single Nginx server_name directive, or only the first domain will work. You’ll need separate configurations for each domain, with each one proxying back to 172.17.0.1:8000.
Client Side
The client-side configuration is slightly more complex. Here is the config file frpc.toml:
| |
And the docker-compose.yml:
| |
Start it up:
| |