0.云服务器需要打开的端口:7000、80
1.反代将来自80端口的HTTP请求转发至FRPS
2.FRPS和FRPC之间通过7000通讯
3.FRPC接收到转发过来的流量,转发至本地80端口
以上所有端口都可以通过docker、nginx、frpc各种组合配置
增加反代的目的是捕获请求源的IP
frps.ini:
cat > /etc/frps/frps.ini <
nginx default.conf:
cat > /etc/nginx/conf.d/default.conf <
docker:
docker network create -d bridge frp-netdocker run --restart=always -p 7000:7000 --network frp-net -d -v /etc/frp/frps.ini:/etc/frp/frps.ini --name frps snowdreamtech/frpsdocker run --restart=always -p 80:80 --network frp-net -d -v /etc/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf --name nginx rsnow/nginx
客户端https://github.com/fatedier/frp/releases/download/v0.39.1/frp_0.39.1_windows_amd64.zip
frpc.ini:
[common]server_addr = {server.ip}server_port = 7000# console or real logFile path like ./frpc.loglog_file = ./frpc.log# trace, debug, info, warn, errorlog_level = warn# auth tokentoken =e041a374-1489-4e42-8eb6-38a726fe6489[www]# tcp | udp | http | https | stcp | xtcp, default is tcptype = tcplocal_ip = 127.0.0.1local_port = 80remote_port = 80# limit bandwidth for this proxy, unit is KB and MBbandwidth_limit = 1MB# true or false, if true, messages between frps and frpc will be encrypted, default is falseuse_encryption = true# if true, message will be compresseduse_compression = true
声明本文采用知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议进行许可,发表在CSDN和博客园,欢迎读者转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接!请读者/爬虫们尊重版权