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

A brief discussion on JavaScript throttling and anti-shake

Table of contents Throttling and anti-shake conce...

CentOS6 upgrade glibc operation steps

Table of contents background Compile glibc 2.14 M...

Solution to the problem of var in for loop

Preface var is a way to declare variables in ES5....

Share CSS writing standards and order [recommended for everyone to use]

CSS writing order 1. Position attributes (positio...

Diagram of the process of implementing direction proxy through nginx

This article mainly introduces the process of imp...

Quickly install MySQL5.7 compressed package on Windows

This article shares with you how to install the M...

React Native environment installation process

react-native installation process 1.npx react-nat...

Solution to find all child rows for a given parent row in MySQL

Preface Note: The test database version is MySQL ...

Several implementation methods of the tab bar (recommended)

Tabs: Category + Description Tag bar: Category =&...

JavaScript to implement checkbox selection or cancellation

This article shares the specific code of JavaScri...

Solutions to Mysql index performance optimization problems

The optimization created by MySQL is to add index...

CSS Houdini achieves dynamic wave effect

CSS Houdini is known as the most exciting innovat...

Install Linux rhel7.3 operating system on virtual machine (specific steps)

Install virtualization software Before installing...

jQuery custom magnifying glass effect

This article example shares the specific code of ...