Nexus3卡在初始化且无法正确解析内容类型

时间:2019-07-01 18:06:26

标签: docker nginx nexus nginx-config

我在也使用Nexus3的服务器上的docker容器中运行nginx reverse-proxy。问题是,当尝试从浏览器访问nexus存储库时,我发现页面损坏,其中包含许多控制台错误。我看到的是:console errors

查看“网络”标签后,我发现服务器未为我的请求设置正确的content-type。这是一个对js文件的请求的示例:js file request

有人知道这可能是什么吗?这就是我的nginx.conf的样子:

server {
        listen 443 ssl http2;
        ssl_certificate /etc/ssl/confidential.com/fullchain.cer;
        ssl_certificate_key /etc/ssl/confidential.com/*.confidential.com.key;
        server_name confidential.com;

    location /test {
      proxy_pass http://nexus:8081/;
      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 "https";
    }



    }

1 个答案:

答案 0 :(得分:1)

您有:

location /test {
      proxy_pass http://nexus:8081/;

Nexus的上下文路径需要与通过反向代理服务的上下文路径匹配。编辑$ workdir / etc / nexus.properties并设置“ nexus-context-path = / test”。并将proxy_pass更改为“ proxy_pass http://nexus:8081/test”。