美文网首页
NGINX: 反向代理 Nexus

NGINX: 反向代理 Nexus

作者: chengchaos | 来源:发表于2020-03-12 18:26 被阅读0次
qiwei104.jpg

本文转自: https://www.cnblogs.com/tiantiandas/p/nginx_reverse_proxy_nexus.html

Nginx 反向代理 nexus 的服务, 一直卡在 Initialize...

解决方式是添加一个 header X-Forwarded-Proto:

proxy_set_header X-Forwarded-Proto "https";

nexus.conf

upstream nexus-server{
    server 127.0.0.1:8081;
}

server {
    listen 80;
    server_name xx.xx;
    location / {
        return 301 https://xx.xx;
    }

    location ~ /.well-known {
        root /tmp;
    }
}

server {
    listen 443 ssl;
    server_name xx.xx;

    ssl_certificate cert/xx.pem;
    ssl_certificate_key cert/xx.key;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto "https";
        proxy_pass http://nexus-server;
    }
}

相关文章

网友评论

      本文标题:NGINX: 反向代理 Nexus

      本文链接:https://www.haomeiwen.com/subject/bllbjhtx.html