NGINX: 反向代理 Nexus

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

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

    proxy_set_header X-Forwarded-Proto "https";



Nginx 配置

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;
    }
}

转载于:https://www.cnblogs.com/tiantiandas/p/nginx_reverse_proxy_nexus.html

展开阅读全文
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读