Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use nginx proxy to support HTTPS protocol in Nexus

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains how Nexus uses nginx agent to support HTTPS protocol, the content is clear, interested friends can learn, I believe it will be helpful after reading.

Background

All websites of the company need to support the HTTPS protocol, which caused errors in the HTTPS access of Nexus after the SSL certificate was configured for Ali Cloud load balancer.

Access path to the website: the domain name is resolved to Aliyun's cloud load balancer. The load balancer is configured with port 80 to forge port 443,443 is configured with SSL certificate, and forwarded to the private network nginx, and the private network nginx is then proxied for the Nexus service.

Solve

Browser HTTPS accesses the Console error message of Nexus:

The error message roughly means that HTTP requests are not allowed on the pages visited by HTTPS.

Solution: add "proxy_set_header X-Forwarded-Proto https;" to the nginx configuration file so that nginx uses the HTTPS protocol when forwarding.

Nexus configuration in nginx.conf:

Location ^ ~ / nexus {proxy_pass http://x.x.x.x:8080/nexus; sendfile off; 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; # uses the https protocol proxy_max_temp_file_size 0 when forwarding # This is the maximum upload size client_max_body_size 20m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_temp_file_write_size 64k; # Required for new HTTP-based CLI proxy_http_version 1.1; proxy_request_buffering off; proxy_buffering off # Required for HTTP-based CLI to work over SSL} after reading the above content, do you have a better understanding of how Nexus uses nginx proxy to support HTTPS protocol? if you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report