How to Use frp for Secure Intranet Penetration and Custom Domain Routing
This guide explains how to set up the open‑source frp tool to expose local web services through a public domain, covering repository cloning, configuration file edits, service startup, phpStudy virtual‑host settings, error troubleshooting, custom sub‑ and third‑level domains, multi‑client setups, and optional Nginx reverse‑proxy integration.
frp Overview
Repository:
https://github.com/fatedier/frpClient configuration (frpc.ini)
[common]
server_addr = frp.yo1c.cc
server_port = 7000
log_level = info
log_max_days = 3
privilege_token = 30064E394C1C63766DA345EEFDA490EF
[pay]
type = http
local_ip = 127.0.0.1
local_port = 80
subdomain = tinywan
pool_count = 10Running the client
./frpc -c ./frpc.ini
# Example log output
2018/07/09 18:05:44 [I] login to server success, get run id [61198354d3f13b48]
2018/07/09 18:05:45 [I] [pay] start proxy successError handling
If the client prints login to server failed: EOF or broken pipe, the client and server versions are mismatched.
Custom domain configuration
Server side (frps.ini)
[common]
bind_port = 7000
vhost_http_port = 8080
# optional token
token = 2W/WktjD1QB9xX/oDZSnH8mv81xzLNU283ern8YiFtY=DNS A record:
frp.tinywan.top → 139.224.239.21Client side
[common]
server_addr = 139.224.239.21
server_port = 7000
[web]
type = http
local_port = 80
custom_domains = frp.tinywan.topSecond‑level sub‑domain example
[notes]
type = http
local_ip = 127.0.0.1
local_port = 80
use_encryption = false
use_compression = false
subdomain = notes
[pay]
type = http
local_ip = 127.0.0.1
local_port = 80
use_encryption = false
use_compression = false
subdomain = payAccess URLs:
http://notes.tinywan.top:8007/index/index/last_insert_id http://pay.tinywan.top:8007/index/index/last_insert_idThird‑level (wildcard) sub‑domain
Wildcard DNS *.frp.tinywan.top → 139.224.239.21. Add subdomain_host = frp.tinywan.top to the server configuration.
Client entry for notes:
[notes]
type = http
local_ip = 127.0.0.1
local_port = 80
use_encryption = false
use_compression = false
subdomain = notesCorresponding Apache/PhpStudy virtual host (shown as a code block):
<VirtualHost *:80>
DocumentRoot "D:\phpStudy\PHPTutorial\WWW
otes\public"
ServerName notes.env
ServerAlias notes.frp.tinywan.top
<Directory "D:\phpStudy\PHPTutorial\WWW
otes\public">
Options FollowSymLinks ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>Browser URL:
http://notes.frp.tinywan.top:8007Multiple client configuration
[notes]
type = http
local_ip = 127.0.0.1
local_port = 80
subdomain = notes
[pay]
type = http
local_ip = 127.0.0.1
local_port = 80
subdomain = payOptional Nginx reverse proxy
server {
server_name notes.frp.tinywan.top;
location / {
proxy_pass http://0.0.0.0:8007;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# Duplicate block for pay.frp.tinywan.topWindows batch file to start frp
frpc.exe -c frpc.ini
pauseSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
