多人使用frp

2020-09-28 15:49:58 阅读:12 编辑

使用 0.21版本

https://github.com/fatedier/frp
服务端配置
go.conf(nginx)
server{
    listen 80;
    server_name *.go.xmyunce.com;
    location / {
        proxy_pass    http://127.0.0.1:5002;
        proxy_set_header    Host    $host:80;
        proxy_set_header    X-Real-IP    $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_hide_header    X-Powered-By;
    }
   location ~ ^/MP_verify_9QEc9I7Sz56YovMT.txt{
        default_type text/html;
        return 200 '9QEc9I7Sz56YovMT';
    }
}
frps配置
[common]
bind_port = 5001
vhost_http_port=5002
token=487e7dc1c6b77ccda02a88a233c9046e
subdomain_host = go.xmyunce.com
启动服务器
./frps.exe -c frps.ini &
使用docker启动服务器
docker run  --network host -d -v /opt/go/frp_0.21.0_linux_amd64/frps.ini:/etc/frp/frps.ini --name frps snowdreamtech/frps
win客户端配置
[common]
server_addr = go.xmyunce.com
server_port = 5001
token = 487e7dc1c6b77ccda02a88a233c9046e
[web]
type = http
local_ip = 127.0.0.1
local_port = 8081
subdomain = lin
启动客户端
frpc.exe -c frpc.ini
#frpc.ini可以忽略
使用
  1. 打开http://lin.go.xmyunce.com 相当于打开内网 http://127.0.0.1:8081

    注意事项

  2. 阿里云要开放5001端口