frpc.toml 中网站代理配置:
[[proxies]]
name = "api.test.com"
type = "https"
localIP = "192.168.123.180"
localPort = 443
compression = true
subDomain = "api"
transport.proxyProtocolVersion='v1'
nginx中api.test.com的配置:
server
{
listen 80;
listen 443 ssl http2 proxy_protocol;
set_real_ip_from 192.168.123.180; # FRP 服务器的 IP 地址
real_ip_header proxy_protocol;
server_name api.test.com;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/api.test.com/public;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#HTTP_TO_HTTPS_START
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
#HTTP_TO_HTTPS_END
ssl_certificate /www/server/panel/vhost/cert/api.test.com/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/api.test.com/privkey.pem;
ssl_protoco

本文详细解释了如何在frpc.toml中配置网站代理,包括api.test.com的HTTPS代理设置,以及nginx中的相关SSL配置,如SSL证书、协议版本、加密算法等。还涉及了错误页面处理和URL重写规则。

1万+

被折叠的 条评论
为什么被折叠?



