mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 16:55:56 +03:00
[GH-ISSUE #107] Cannot read properties of undefined (reading 'status') #5837
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#5837
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sochanged on GitHub (Apr 26, 2023).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/107
1、使用过程中遇到这样的问题:
这是在错误日志中显示出来的报错,伴随面板上体现的错误是当点击“配置管理”标签时,无法打开页面,顶部报错内容为:Cannot
read properties of undefined (reading 'status') ,读取标志持续转动(请见下面截图)。
我设置了将 "http://域名:端口号码/" 跳转为”http://域名/nginx-ui/“ 不知道跟这有么有关系……
因为配置改动的地方比较多,我已经不确定是在哪一段配置之后出现的这个问题……因为我技术很菜,请谅解!
错误屏幕截图:

系统信息:
我使用的是”nginx-ui“+”Xray-ui“+”Acme一键脚本“,希望实现的功能为:搭建(nginx反代)节点服务器并使用nginx代理本地静态页面作为访问纯域名(不带端口和路径)的结果。我还使用了CF的 CDN,并且打开了CF的完全(严格)的加密模式。
麻烦大佬给看看可能是什么原因造成的~
2、另外有个建议,能否在偏好设置中加入“HTTP 监听端口“的设置选项(就像HTTP Challenge 监听端口那样)?
3、还有一个使用中的疑问,就是我不管怎么设置用nginx-ui代理本地服务器上本地的静态网页,都无法正常打开(另外来说,其他协议的节点又都可以正常工作),取而代之的是永远指向nginx的默认页面如下图:

不知大佬有没有时间给科普一下在您的nginx-ui面板中在哪个模块中、怎么设置这静态页面。
@0xJacky commented on GitHub (Apr 27, 2023):
@sochanged commented on GitHub (Apr 27, 2023):
nginx配置文件nginx.conf如下(我的静态页面实际存放位置为:“/var/www/html”):
`user root;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/.conf;
events {
worker_connections 1024;
}
http {
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
map $http_x_forwarded_for $clientRealIp {
"" $remote_addr;
~^(?P[0-9.|:|a-f.|:|A-F.|:]+),?.$ $firstAddr;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
log_format main escape=json '$clientRealIp $remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" "$http_host"';
access_log /var/log/nginx/access.log main;
client_max_body_size 20m;
server_tokens off;
sendfile on;
sendfile_max_chunk 512k;
tcp_nopush on;
tcp_nodelay on;
proxy_store on;
reset_timedout_connection on;
send_timeout 900;
charset 'UTF-8';
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
include /etc/nginx/conf.d/.conf;
include /etc/nginx/sites-enabled/;
upstream xray-ui {
least_conn;
keepalive 1000;
server 127.0.0.1:8443 fail_timeout=30s max_fails=3;
}
server {
listen 443 ssl;
server_name ab.ABC.com;
ssl_certificate /etc/ssl/cert/cert.crt;
ssl_certificate_key /etc/ssl/cert/cert.key;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
location /nginx-ui/ {
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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://127.0.0.1:2053/;
}
location /12345/ {
proxy_redirect off;
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_ssl_session_reuse off;
proxy_ssl_server_name on;
proxy_buffering off;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_http_version 1.1;
proxy_set_header Accept-Encoding "";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://xray-ui;
proxy_set_header Connection "keep-alive";
proxy_store off;
}
}
}`
sites-available中的default配置如下:
`
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name _;
}`
Xray配置文件“/usr/local/xray-ui/bin/config.json”如下:
`
{
"log": null,
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"domain": [
"www.gstatic.com"
],
"outboundTag": "direct"
},
{
"type": "field",
"domain": [
"geosite:category-ads-all",
"geosite:cn",
"geosite:geolocation-cn"
],
"outboundTag": "blocked"
},
{
"type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "blocked"
}
]
},
"dns": null,
"inbounds": [
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"streamSettings": null,
"tag": "api",
"sniffing": null
},
{
"listen": null,
"port": 2087,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "5d51ec47-5e94-4b78-fd2a-50446548e713",
"alterId": 0
}
],
"disableInsecureEncryption": false
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"path": "/5d51ec47-5e94-4b78-fd2a-50446548e713",
"headers": {}
},
"sockopt": {
"tcpFastOpen": false,
"domainStrategy": "AsIs",
"tcpcongestion": "bbr",
"acceptProxyProtocol": false,
"tcpKeepAliveIdle": 0,
"tcpKeepAliveInterval": 0,
"interface": ""
}
},
"tag": "inbound-2087",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
},
{
"listen": null,
"port": 2083,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "6d0d39b4-b3e5-466e-8ed5-696f47a5f8a6",
"flow": ""
}
],
"decryption": "none",
"fallbacks": []
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"path": "/6d0d39b4-b3e5-466e-8ed5-696f47a5f8a6",
"headers": {}
},
"sockopt": {
"tcpFastOpen": false,
"domainStrategy": "AsIs",
"tcpcongestion": "bbr",
"acceptProxyProtocol": false,
"tcpKeepAliveIdle": 0,
"tcpKeepAliveInterval": 0,
"interface": ""
}
},
"tag": "inbound-2083",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
},
{
"listen": null,
"port": 2096,
"protocol": "trojan",
"settings": {
"clients": [
{
"password": "eqJWsRJCuw"
}
],
"fallbacks": []
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"path": "/eqJWsRJCuw",
"headers": {}
},
"sockopt": {
"tcpFastOpen": false,
"domainStrategy": "AsIs",
"tcpcongestion": "bbr",
"acceptProxyProtocol": false,
"tcpKeepAliveIdle": 0,
"tcpKeepAliveInterval": 0,
"interface": ""
}
},
"tag": "inbound-2096",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
},
"tag": "blocked"
}
],
"transport": null,
"policy": {
"system": {
"statsInboundDownlink": true,
"statsInboundUplink": true
},
"levels": {
"0": {
"handshake": 2,
"connIdle": 120,
"uplinkOnly": 1,
"downlinkOnly": 1
}
}
},
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"stats": {},
"reverse": null,
"fakeDns": null
}
`
实在是不好意思,请原谅我太菜了,这个代码框我就是弄不好……我已经非常尽力了,上面这些就是我这一个礼拜自己瞎鼓捣的结果,一个礼拜之前,我从来没用过没有UI界面的工具软件……万望海涵!给您添麻烦了!
@0xJacky commented on GitHub (Apr 27, 2023):
配置到子目录的话可以参考这个
如果你也是这样写的,试试 reload一下 nginx。
@0xJacky commented on GitHub (Apr 27, 2023):
创建了新站点之后要点启用才行,不然就会显示默认的页面
@0xJacky commented on GitHub (Apr 27, 2023):
噢,你 nginx.conf 没有include sites-enabled/*.conf 所以 UI 添加的东西都没有生效
@0xJacky commented on GitHub (Apr 27, 2023):
总的来说,你不应该把所有站点的配置文件放在 nginx.conf 中。相关配置的细节建议您先配置 Nginx UI 中的 ChatGPT Token,然后使用在线助手解答您在配置上的问题。按照我说的改完应该就可以了,这并没有涉及到 Nginx UI 设计上的问题,我就先关掉这个 issue 了。
如果后面还是无法正常使用,建议您先还原配置,然后在 nginx.conf 中 include sites-enabled/*.conf,reload nginx,之后先不使用 cf 加速,逐步调试检查问题。