frp
frps.ini
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
[common] bind_addr = 0.0.0.0 bind_port = 17000 vhost_http_port = 17001 vhost_https_port = 17002 bind_udp_port=17004 token=sadfa # dashboard 用户名密码,默认都为 admin dashboard_port = 17003 dashboard_user = 123 dashboard_pwd = 123 log_file = ./frps.log log_level = info log_max_days = 3 heartbeat_timeout = 90 privilege_allow_ports = 6000-17000, 3001 max_pool_count = 100 max_ports_per_client = 0 authentication_timeout = 0 tcp_mux = true subdomain_host = f.er.top
frpc.init
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
[common] server_addr = 101.3.5.1 server_port = 17000 token=sadfa [zhoudao-api] type = http local_ip = 192.1.1.3 local_port = 9051 remote_port = 17001 use_encryption = false use_compression = true subdomain=zi [zhoudao-chat] type = http local_ip = 1.1.1.3 local_port = 9055 remote_port = 17001 use_encryption = false use_compression = true subdomain=zt
nginx.conf
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
server { listen 443 ssl http2; server_name *.f.yu.top; #填写绑定证书的域名 # ssl on; ssl_certificate /etc/letsencrypt/live/f.yu.top/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/f.yu.top/privkey.pem; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers "EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5"; ssl_session_cache builtin:1000 shared:SSL:10m; # openssl dhparam -out /usr/local/nginx/ssl/dhparam.pem 2048 #ssl_dhparam /usr/local/nginx/ssl/dhparam.pem; client_max_body_size 50M; client_header_timeout 3600s; client_body_timeout 3600s; fastcgi_connect_timeout 3600s; fastcgi_send_timeout 3600s; fastcgi_read_timeout 3600s; location ~ \.txt$ { # 存放校验文件目录的绝对路径 root /etc/nginx/weixin; } location / { # 7071端口即为frp监听的http端口 proxy_pass http://127.0.0.1:17001; 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_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_connect_timeout 7d; proxy_send_timeout 7d; proxy_read_timeout 7d; } # 防止爬虫抓取 if ($http_user_agent ~* "360Spider|JikeSpider|Spider|spider|bot|Bot|2345Explorer|curl|wget|webZIP|qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot|NSPlayer|bingbot") { return 403; } }
参考
https://www.zywvvd.com/notes/environment/nas/frp-usage/frp-usage/