问题

状态如下

https

cf tls

3XUI面板套CF后,无法通过域名访问

解决方法

只需安装并配置 Nginx 进行反向代理即可,具体配置如下:

http {
    # 其他配置项...
    server {
        listen 80;
        server_name 你的域名;

        # 配置反向代理
        location / {
            proxy_pass https://127.0.0.1/;  # 将请求转发到本地 443 端口
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_ssl_verify off;  # 禁用 SSL 证书验证
        }
    }
}

修改完配置后,使用以下命令检查配置文件是否正确:

sudo nginx -t

如果出现以下消息,说明配置没有问题:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

然后执行重启操作以使配置生效:

sudo systemctl reload nginx

如果出现提示 nginx.service is not active, cannot reload.,说明 Nginx 未启动,使用以下命令启动 Nginx:

sudo systemctl start nginx

这样就完成了配置。

文章目录