我可以在端口8081的服务器上运行Nexus 3.2.0-01,但是我想将其作为https:// HOST / nexus /运行,通过nginx反向代理。
根据文档,我需要设置一个基本URL功能。然后,将其添加到我的nginx配置中:
location /nexus/ {
proxy_pass http://localhost:8081/;
# Rewrite HTTPS requests from WAN to HTTP requests on LAN
proxy_redirect http:// https://;
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";
}
Run Code Online (Sandbox Code Playgroud)
完成此操作后,我可以访问Nexus,但无法加载图片,无法加载javascript等。查看Chrome的控制台后,Nexus似乎要访问以下网址:
https://HOST/static
https://HOST/service
https://HOST/repository
Run Code Online (Sandbox Code Playgroud)
代替:
https://HOST/nexus/static
https://HOST/nexus/service
https://HOST/nexus/repository
Run Code Online (Sandbox Code Playgroud)
我找不到任何方法可以配置Nexus来全面利用Base URL功能。
我试过了:
但是没有运气(不是我希望生成的URL基于nginx配置引用/ nexus,我想不出要尝试的其他方法)。
最后,我为/ static,/ service和/ repository添加了proxy_passes(假设我没有遗漏任何东西),乍一看它似乎可以工作,尽管我还没有尝试发布或做过很多尝试。
Nexus无法正确使用基本网址,我在做什么错?