使用 Sonatype Nexus,我仅在访问 /nexus/#admin/support/status
时收到此错误消息.
Ext.JSON.decode(): You're trying to decode an invalid JSON String: Nexus Repository Manager (new Image).src="http://localhost/nexus/static/rapture/resources/favicon.ico?_v=3.17.0-01&_e=OSS"</script> function progressMessage(msg) { if (console && console.log) { console.log(msg); } document.getElementById('loading-msg').innerHTML=msg; } Loading ... progressMessage('Loading baseapp-prod.js'); progressMessage('Loading extdirect-prod.js'); progressMessage('Loading bootstrap.js'); progressMessage('Loading d3.v4.min.js'); progressMessage('Loading nexus-rapture-prod.js'); progressMessage('Loading nexus-blobstore-s3-prod.js'); progressMessage('Loading nexus-rutauth-plugin-prod.js'); progressMessage('Loading nexus-coreui-plugin-prod.js'); progressMessage('Loading nexus-proui-plugin-prod.js'); progressMessage('Loading nexus-repository-pypi-prod.js'); progressMessage('Loading nexus-repository-maven-prod.js'); progressMessage('Loading nexus-repository-npm-prod.js'); progressMessage('Loading nexus-onboarding-plugin-prod.js'); progressMessage('Loading nexus-repository-nuget-prod.js'); progressMessage('Loading nexus-repository-rubygems-prod.js'); progressMessage('Loading nexus-repository-docker-prod.js'); progressMessage('Loading app.js'); progressMessage('Initializing ...');
我正在使用反向代理 (nginx) 来分配 RUT header 以进行授权,如下所示:
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
responsecode 和 X-Forwarded-User 被发送到标题和正文中的一个空 JSON 对象(否则在主页中提示 nexus)。我想知道这个空的 JSON 对象是否可能是我在 nexus 状态页面上收到此消息的原因,以及我可以做些什么来避免它。对于 Nexus Ext js,是否有 JSON-response-body 必须遵循的预定义格式?
最佳答案
关于extjs - 访问 Nexus 配置 - Ext.JSON.decode() : You're trying to decode an invalid JSON String:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56953741/