Nexus uses nginx proxy to support HTTPS protocol

Nexus uses nginx proxy to support HTTPS protocol

background

All company websites need to support the HTTPS protocol. After the SSL certificate is configured on Alibaba Cloud Load Balancing, HTTPS access to Nexus fails.

Website access path: The domain name is resolved to Alibaba Cloud's load balancing, the load balancing is configured to force port 80 to port 443, the 443 port is configured with an SSL certificate and forwarded to the intranet nginx, and the intranet nginx then proxies the Nexus service.

solve

The browser HTTPS access Nexus Console error message:

The error message roughly means: HTTP requests are not allowed on pages accessed via 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 content in nginx.conf:

location ^~ /nexus {

    proxy_pass http://xxxx: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; # Use https protocol when forwarding proxy_max_temp_file_size 0;

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

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed configuration of Nginx supporting both Http and Https
  • Use nginx + secondary domain name + https support
  • Sample code for configuring nginx to support https
  • Detailed explanation of nginx using ssl module configuration to support HTTPS access
  • How to build and configure Nginx to support HTTPS
  • How to use ssl module to configure nginx to support HTTPS access
  • Detailed explanation of how to use ssl module to configure HTTPS support in nginx
  • CentOS7 configuration Nginx support HTTPS access implementation solution
  • Nginx configures the same domain name to support both http and https access

<<:  MySQL cross-table query and cross-table update

>>:  Detailed explanation of the difference between arrow functions and normal functions in JavaScript

Recommend

Introduction to the use of CSS3 filter attribute

1. Introduction When writing animation effects fo...

mysql installer community 8.0.12.0 installation graphic tutorial

This tutorial shares the installation of mysql in...

A simple example of mysql searching for data within N kilometers

According to the coefficient of pi and the radius...

Vue implements automatic jump to login page when token expires

The project was tested these days, and the tester...

js implements mouse in and out card switching content

This article shares the specific code of js to re...

What I learned while building my own blog

<br />In one year of blogging, I have person...

Javascript uses the integrity attribute for security verification

Table of contents 1. Import files using script ta...

How to delete all contents in a directory using Ansible

Students who use Ansible know that Ansible only s...

Use node-media-server to build a simple streaming media server

Record some of the processes of using node-media-...