Operations 7 min read

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.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
How to Use frp for Secure Intranet Penetration and Custom Domain Routing

frp Overview

Repository:

https://github.com/fatedier/frp

Client 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 = 10

Running 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 success

Error 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.21

Client side

[common]
server_addr = 139.224.239.21
server_port = 7000

[web]
type = http
local_port = 80
custom_domains = frp.tinywan.top

Second‑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 = pay

Access URLs:

http://notes.tinywan.top:8007/index/index/last_insert_id
http://pay.tinywan.top:8007/index/index/last_insert_id

Third‑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 = notes

Corresponding 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:8007

Multiple 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 = pay

Optional 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.top

Windows batch file to start frp

frpc.exe -c frpc.ini
pause
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Nginxfrpintranet tunnelingphpStudyDomain Configuration
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.