最近买了一个vps,搭建了3x-ui,正常使用http://ip:port/根路径 就可以访问
正好手里有一个us.kg的域名,就像使用域名+https(使用cf的ssl证书)来访问x-ui的页面。
目前配置好ngnix后,将http://ip:port/根路径 改为域名/根路径。测试结果404
下面是nginx的相关配置
root@cheerful-beep-1:/etc/nginx/sites-enabled# cat default
server {
listen 443 ssl http2;
server_name xx.ab.us.kg;
ssl_certificate /etc/nginx/cert/public.pem;
ssl_certificate_key /etc/nginx/cert/private.key;
location /info {
proxy_pass http://127.0.0.1:1017/;
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;
}
location / {
return 404; # 拒绝其他未匹配的请求
}
}
日志如下
[17/Nov/2024:06:35:33 -0800] "GET /info/ HTTP/2.0" 404 176 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" https
2024/11/17 06:04:24 [error] 17165#17165: *1 open() "/usr/share/nginx/html/info" failed (2: No such file or directory), client: 172.70.211.136, server: bwg.maxchan.us.kg, request: "GET /info HTTP/2.0", host: "bwg.maxchan.us.kg"
从日志上看,好像是端口转发失败了,请求了静态资源
想问一下是不是我的配置出了问题