frps.ini
[common]
bind_port = 7000
vhost_http_port = 8080
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
[ssh]
listen_port = 6000
auth_token = PASSWORD
[web]
type = http
custom_domains = a.jinmed.cn
auth_token = PASSWORD
[web2]
type = http
custom_domains = b.jinmed.cn
auth_token = PASSWORD
解释:
bind_port: 就是向外提供的端口, 平时ssh远程登陆采用这个端口
vhost_http_port: 向外提供的http端口
dashboard_*: 面板的配置
然后运行./frps -c ./frps.ini ,我一开只是./frps,就会出现vhost_http_port is not set 的错误
frpc.ini
[common]
server_addr = SERVER_IP_ADDRESS
server_port = 7000
auth_token = PASSWORD
vhost_http_port = 8080
[web01]
type = http
local_ip = CLIENT_IP1
local_port = CLIENT_PORT1
custom_domains = a.jinmed.cn
[web02]
type = http
local_ip = CLIENT_IP2
local_port = CLIENT_PORT2
custom_domains = b.jinmed.cn
服务器和客户端都需要配置两个web,并且域名不一样,要先解析好域名,本地的ip地址和端口可以不是本机的,只要是192.168..下面的就行了
本文参考了[https://www.jianshu.com/p/93bf511ea72e]