frps:
具体配置定义查看 FRP服务端配置
[common]
bind_addr = 0.0.0.0
bind_port = 9960
bind_udp_port = 9967
kcp_bind_port = 9960
proxy_bind_addr = 0.0.0.0
allow_ports = 808,4438
vhost_http_timeout = 360
log_level = info
log_max_days = 3
token = klsdfghfg
heartbeat_timeout = 90
tcp_mux = true
max_pool_count = 5
max_ports_per_client = 0
log_file = ./frps.log
enable_prometheus = false
FRPC
具体配置定义查看 FRP客户端配置
[common]
server_addr = 20.25.23.24
server_port = 9960
token = klsghfg
[webhttp]
type = tcp
local_ip = 127.0.0.1
local_port = 80
remote_port = 808
[webhttps]
type = tcp
local_ip = 127.0.0.1
local_port = 443
remote_port = 4438
自己自用的话 服务端宝塔新建站点 设置SSL证书 要不要强制跳转使用宝塔本身的功能就行,然后反向代理到你的frp808端即可
客户端只需要新建一个站点 绑定域名 SSL无所谓
服务端新建站点,修改配置文件 修改过后不要使用宝塔的伪静态,重定向,反向代理
```
server
{
listen 80;
server_name cs.nnue.eu.org; # 你的域名
return 301 https://$host$request_uri;
# 使80自动跳转443,不需要可以注释上面的 然后取消下面的location块的注释
# location /
# {
# proxy_pass http://127.0.0.1:808;
# #proxy_redirect http://$host/ http://$http_host/;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $host;
# resolver 114.114.114.114;
# }
}
server
{
listen 443 ssl http2;
server_name cs.nnue.eu.org;
# 下面是SSL证书存放位置,客户端,服务端都要SSL证书
ssl_certificate /www/server/panel/vhost/cert/cs.nnue.eu.org/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/cs.nnue.eu.org/privkey.pem;
location /
{
proxy_pass https://127.0.0.1:4438;
#proxy_redirect https://$host/ https://$http_host/;
proxy_ssl_server_name on;
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;
proxy_set_header Host $host;
}
}
```
参与讨论