frp nginx 配置

nohup /opt/frps/frps -c /opt/frps/frps.ini > log.log 2>&1 &

nginx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
map $scheme $frp_proxy_port {
"http" "8880";
"https" "8881";
default "8880";
}

server {
listen 80;
listen [::]:80;
server_name frp.zuim.cn;

location / {
proxy_intercept_errors on;
proxy_pass http://127.0.0.1:7500;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Nginx-Proxy true;
proxy_set_header Connection "";
}

access_log off;
log_not_found off;
}

server {
listen 80;
listen [::]:80;
server_name *.zuim.cn;

location / {
proxy_intercept_errors on;
proxy_pass $scheme://127.0.0.1:$frp_proxy_port;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Nginx-Proxy true;
proxy_set_header Connection "";
}

access_log off;
log_not_found off;
}

frps

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[common]
bind_addr = xxx.xxx.xxx.xxx
bind_port = 7000

vhost_http_port = 8880
vhost_https_port = 8881

dashboard_port = 7500

log_file = /data/logs/frps.log
log_level = warn
log_max_days = 3

privilege_mode = true
privilege_token = xxxxx
privilege_allow_ports = 3790-4790

max_pool_count = 50

frpc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[common]
server_addr = x.x.x.x(替换为服务器 ip)
server_port = 7000

log_file = /opt/frp/frpc.log
log_level = warn
log_max_days = 3

privilege_token = xxxxx(替换掉)

[n54l_ssh]
privilege_mode = true
type = tcp
local_ip = 127.0.0.1
local_port = 22
use_encryption = false
use_gzip = false
remote_port = 3794