Skip to content

CentOS Frp 配置教程

Published: at 03:32 PMSuggest Changes

服务器端

一键配置,方便 https://github.com/MvsCode/frps-onekey

客户端

看文档配置即可

https://gofrp.org/docs/examples/vhost-http/

[common]
server_addr = xx.xx.xx.xx(外网 ip)
server_port = 7000

[web]
type = http
local_ip = (内网服务器 ip)
# 转发到 nginx 监听的端口
local_port = 80
custom_domains = xx.xx.xx.xx(外网 ip,和 server_addr 的相同)

nginx 配置

server {
  listen       80;
  server_name  localhost;

  location / {
      root   html;
      index  index.html index.htm;
  }
  location ^~ /xxx(解析的路径){
      proxy_pass http://xxx.xxx.xx.xx/xxx(转发的内网地址);
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
  }

Previous Post
JavaScript 获取浏览器信息
Next Post
专用网络的 CORS (RFC1918) 问题研究及解决方案