Reference: The newest version for now is frp_0.64.0_linux_amd64.tar.gz Official website: https://github.com/fatedier/frp/releases Document: https://github.com/fatedier/frp/blob/dev/README_zh.md https://gofrp.org/en/docs/reference/common/#webserverconfig https://www.cnblogs.com/shook/p/12790532.html

1. Transform HTTPS

1.1. Config nginx

Config Domain A record “tools.duchaoqun.cn” to this address on Cloudflare.

Config location / to 127.0.0.1 on server, proxy the frp http service.

    server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        ssl_certificate         /etc/nginx/duchaoqun.cn.pem;
        ssl_certificate_key     /etc/nginx/duchaoqun.cn.key;
        server_name  localhost;
        root /opt/www;
        index index.html index.htm index.nginx-debian.html;
        location / {
                proxy_pass  http://127.0.0.1:12369;                                      # 映射的frp服务端frps.ini的 vhost_http_port端口
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-NginX-Proxy true;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_max_temp_file_size 0;
                proxy_redirect off;
                proxy_read_timeout 240s;
        }
        location /about {  # 与V2Ray配置中的path保持一致
            proxy_pass       http://127.0.0.1:8484;  # V2Ray 的开放端口
            proxy_redirect             off;
            proxy_http_version         1.1;
            proxy_set_header Upgrade   $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host      $http_host;
        }
    }

1.2. Config Server

Note: different version has different configuration. You must notice that. Note: ini file and toml file are different, the format is different.

[common]
bindPort=7000
vhostHttpPort=12369 # transform service port for nginx.
webServer.addr="0.0.0.0"
webServer.port=7505
webServer.user="root"
webServer.password="loveh129"
 
# Start server with config file.
./frps -c frps.toml

1.3. Transform local 8080(http) to remote 12369

serverAddr = "144.34.214.229"
serverPort = 7000
 
[[proxies]]
name = "test-http"
type = "http"
localIP = "127.0.0.1"
localPort = 8080
customDomains = ["tools.duchaoqun.cn"]

1.4. Transform local 80 with SSL to remote 443

Prepare the SSL certificate in the directory.

Download 20090771_oa.rexen.vip_apache.zip

serverAddr = "39.100.7.228"
serverPort = 7000
 
[[proxies]]
name = "test_htts2http"
type = "https"
customDomains = ["oa.rexen.vip"]
 
[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:8080"
 
# HTTPS 证书相关的配置
crtPath = "./oa.rexen.vip_public.crt"
keyPath = "./oa.rexen.vip.key"
hostHeaderRewrite = "127.0.0.1"
requestHeaders.set.x-from-where = "frp"