美文网首页
Docker部署Nexus配置https

Docker部署Nexus配置https

作者: InGramViking | 来源:发表于2021-04-30 01:02 被阅读0次

前端nginx配置https,转发到Nexus容器


  proxy_send_timeout 120;
  proxy_read_timeout 300;
  proxy_buffering    off;
  server {
    listen       443;
  ssl_certificate /etc/gitlab/ssl/aaa.com.cer;
  ssl_certificate_key /etc/gitlab/ssl/aaa.com.key;
  ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4';
  ssl_protocols  TLSv1.2 TLSv1.3;
  ssl_prefer_server_ciphers on;
  ssl_session_cache  builtin:1000  shared:SSL:10m;
  ssl_session_timeout  5m;
    client_max_body_size 1G;
  
  
    location / {
      proxy_pass http://10.0.0.222:8081/;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header  X-Forwarded-Proto https;    #这里注意一定要配置,不然会转圈
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  }
  
  server {
    listen   80;
    server_name  nexus.aaa.com;
  
    client_max_body_size 1G;
  
  
    location / {
      proxy_pass http://10.0.0.222: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;


image.png

相关文章

网友评论

      本文标题:Docker部署Nexus配置https

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