Location>code7788 >text

Configuring Halo's Reverse Proxy and Requesting SSL Certificates with Nginx Proxy Manager

Popularity:905 ℃/2024-07-30 16:08:25

This article describes the Nginx Proxy Manager configuration Halo reverse proxy and apply for SSL certificates, such as the need to understand Halo 2 installation, refer to theHow to deploy and install Halo via Docker Compose on a Linux cloud server to build a personal blog site?

catalogs
  • Installing Nginx Proxy Manager
    • Nginx Proxy Manager Installation
    • newly built
    • Starting NPM
  • Configuring Halo's Reverse Proxy
  • Apply for SSL Certificate

Installing Nginx Proxy Manager

Nginx Proxy Manager Installation

Nginx Proxy Manager is a proxy manager for Nginx. If you don't have a basic knowledge of Nginx, you can easily use it to complete the reverse proxy operation, and because it comes with a panel, the operation is extremely simple, and it is very suitable for use with docker-built applications.

After installing NPM, you don't need to install Nginx again, otherwise there will be a port conflict (it is not recommended to modify NPM's ports 80 and 443). If you have installed Pagoda Panel on your server, you can also use it with NPM, as long as you go to the backend of the software and close or uninstall the Nginx installed by Pagoda.

newly built

We create a folder to hold the NPM files:

mkdir -p ~/data/docker_data/nginxproxymanager # create a folder for npm

cd ~/data/docker_data/nginxproxymanager # Enter the folder

vi

Under the English input method, press i. When --INSERT-- appears in the lower left corner, paste in the following contents:

version: '3'
services.
  app: 'jc21/nginx-proxy-manager:latest'
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports.
      - '80:80' # It is not recommended to change the ports.
      - '81:81' # You can change the port 81 to the left of the colon to a port that is not occupied on your server.
      - '443:443' # port modification is not recommended
    volumes.
      - . /data:/data # The dot indicates the current folder, the left colon means create a data directory under the current folder to store the data, if it doesn't exist, it will be created automatically.
      - . /letsencrypt:/etc/letsencrypt # The dot indicates the current folder, the colon to the left means create a letsencrypt directory under the current folder for storing certificates, if it doesn't exist, it will be created automatically.

Starting NPM

docker-compose up -d

utilizationhttp://127.0.0.1:81 You can access the NPM web site, the default login username: admin@ password: changeme. the first login will prompt to change the username and password, it is recommended to change a more complex password.

Configuring Halo's Reverse Proxy

First of all, after logging into the web site, a dialog box will pop up to change your username and password, so you can change your username and email address according to your own reality.

After saving, it will ask us to change the password (a complex one is recommended).

Then we can add a reverse proxy to Halo, click Proxy Hosts.

Then click Add Proxy Host to bring up the following dialog box:

Parameter Explanation:

parameter name descriptive
Domain Names Fill in the domain name of our Halo website, first remember to do a DNS resolution and bind the domain name to the IP of our server!
Scheme Default http is fine, unless you have a self-signed certificate.
Forward Hostname/IP Fill in the IP of the server, or the IP inside the Docker container if NPM and Halo are built on the same server.
Forward Port Fill in the port mapped by Halo, the default is 8090.
Cache Assets Cache, with the option to turn on the
Block Common Exploits To block common vulnerabilities, you can choose to turn on the
Websockets Support WS support with the option to turn on
Access List This is a feature that comes with NPM that restricts access, so you can look into it on your own.

Apply for SSL Certificate

NPM supports the application of SSL certificates, the certificate will be automatically renewed in three months, so that the site supports https access. To apply for a certificate, you need to resolve your domain name to the IP of the server where NPM is located in advance.


After successfully applying for the SSL certificate. Tap on Configure again and check it out to turn forced SSL on.

At this point, it's a done deal, completing Halo's reverse proxy.

Original address:Configuring Halo's Reverse Proxy and Requesting SSL Certificates with Nginx Proxy Manager