服务端文件frps.ini配置:
[common]
bind_port = 7000
vhost_http_port = 6699
dashboard_port = 7500
dashboard_user = root
dashboard_pwd = 1234qwer
服务端启动:
./frps -c frps.ini
客户端文件frpc.ini配置:
[common]
server_addr = 123.123.123.123
server_port = 7000
log_level = info
log_max_days = 3
admin_addr = 127.0.0.1
admin_port = 7400
admin_user = root
admin_pwd = root
pool_count = 5
login_fail_exit = true
protocol = tcp
tls_enable = true
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
[web]
type = http
local_port = 8888
custom_domains = aaa.bbb.ccc.com
[mysql_3306]
type = tcp
local_ip = 127.0.0.1
local_port = 3306
use_encryption = false
use_compression = false
remote_port = 23456
客户端启动:
./frpc -c frpc.ini
nginx配置:
server {
listen 80;
server_name *.bbb.ccc.com;
location / {
proxy_pass http://127.0.0.1:6699/;
proxy_set_header Host $host;
proxy_set_header custom_header $http_x_custom_header;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}