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

Detailed explanation of adding dotted lines to Vue element tree controls

Table of contents 1. Achieve results 2. Implement...

Several ways to manually implement HMR in webpack

Table of contents 1. Introduction 2. GitHub 3. Ba...

HTML4.0 element default style arrangement

Copy code The code is as follows: html, address, ...

How to build SFTP server and image server on Linux cloud server

First of all, you can understand the difference b...

mysql5.7.18.zip Installation-free version configuration tutorial (windows)

This is the installation tutorial of mysql5.7.18....

Install Kafka in Linux

Table of contents 1.1 Java environment as a prere...

Process parsing of reserved word instructions in Dockerfile

Table of contents 1. What is Dockerfile? 2. Analy...

How to understand the difference between computed and watch in Vue

Table of contents Overview computed watch monitor...

Ubuntu 15.04 opens mysql remote port 3306

Ubuntu 15.04 opens MySQL remote port 3306. All th...

MySQL 5.7.20 installation and configuration method graphic tutorial (win10)

This article shares the installation and configur...

MySQL FAQ series: When to use temporary tables

Introduction to temporary tables What is a tempor...

Best Practices Guide for MySQL Partitioned Tables

Preface: Partitioning is a table design pattern. ...

Learn more about the most commonly used JavaScript events

Table of contents JavaScript events: Commonly use...

Font Treasure House 50 exquisite free English font resources Part 2

Designers have their own font library, which allo...