Frp配置内网穿透

Frp 配置内网穿透

服务器端配置文件 frps.ini

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frp 服务端口及 token
[common]
bind_port = 7000
token = 123456

# frp 后台管理账号
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin

# 配置日志配置文件夹
log_file = /usr/local/web/frp/frps.log
log_level = info
log_max_days = 3

修改 Nginx 配置并开放端口

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
server {
location / {
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://127.0.0.1:16389;
}
listen 443 ssl;
server_name test.abc.ink;
ssl_certificate /etc/tencentssl/test.abc.ink_bundle.crt;
ssl_certificate_key /etc/tencentssl/test.abc.ink.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security "max-age=31536000";
}

客户端配置 frpc.ini

1
2
3
4
5
6
7
8
9
10
[common]
server_addr = 服务器的 ip
server_port = 7000
token = 123456

[内网穿透]
type = tcp
local_ip = 127.0.0.1
local_port = 8088
remote_port = 16389

8088 为本地端口,16389 为服务器开放端口

测试 https://test.abc.ink