使用Sonatype Nexus,我仅在访问/nexus/#admin/support/status
时收到此错误消息。
Ext.JSON.decode():您正在尝试解码无效的JSON字符串:Nexus Repository Manager(新映像).src =“ http://localhost/nexus/static/rapture/resources/favicon.ico ?_v = 3.17.0-01&_e = OSS“ 函数progressMessage(msg){if(console && console.log){console.log(msg); } document.getElementById('loading-msg')。innerHTML = msg; }正在加载... progressMessage('正在加载baseapp-prod.js'); progressMessage('正在加载extdirect-prod.js'); progressMessage('Loading bootstrap.js'); progressMessage('正在加载d3.v4.min.js'); progressMessage('正在加载nexus-rapture-prod.js'); progressMessage('正在加载nexus-blobstore-s3-prod.js'); progressMessage('正在加载nexus-rutauth-plugin-prod.js'); progressMessage('正在加载nexus-coreui-plugin-prod.js'); progressMessage('正在加载nexus-proui-plugin-prod.js'); progressMessage('正在加载nexus-repository-pypi-prod.js'); progressMessage('正在加载nexus-repository-maven-prod.js'); progressMessage('正在加载nexus-repository-npm-prod.js'); progressMessage('正在加载nexus-onboarding-plugin-prod.js'); progressMessage('正在加载nexus-repository-nuget-prod.js'); progressMessage('正在加载nexus-repository-rubygems-prod.js'); progressMessage('正在加载nexus-repository-docker-prod.js'); progressMessage('正在加载app.js'); progressMessage('正在初始化...');
我正在使用反向代理(nginx)分配用于授权的RUT标头,如下所示:
server {
listen 80; server_name localhost;
location /auth {
proxy_set_header Host $host;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_pass http://nexus-proxy:8080;
}
location /nexus {
auth_request /auth;
auth_request_set $user $upstream_http_x_forwarded_user;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-User $user;
proxy_pass http://nexus:8081;
}
}
在成功通过身份验证后,200
响应代码和X-Forwarded-User将发送到标头,并且正文中有一个空的JSON对象(否则,主页上会出现nexus抱怨)。
我想知道这个空的JSON对象是否可能是我在链接状态页面上收到此消息的原因,以及如何避免该消息。对于Nexus Ext js,JSON-response-body是否必须遵循一种预定义的格式?