Introduction: NginxWebUI is a visual management tool for configuring Nginx load balancing and reverse proxy. You can use this tool to easily manage and configure Nginx, as well as view its running status and logs.

Step One: Update Sources

For Ubuntu/Debian:

sudo apt-get update -y && sudo apt-get upgrade -y

For CentOS:

sudo yum update -y && sudo yum upgrade -y

Step Two: Install and Configure Docker

Install Docker:

curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh ./get-docker.sh

Start Docker:

sudo systemctl start docker

Set Docker to start automatically at boot:

sudo systemctl enable docker

Step Three: Pull the Docker Image for NginxWebUI

You can pull the Docker image for NginxWebUI from Docker Hub or the Aliyun image repository. Choose one of the following commands to run:

docker pull cym1102/nginxwebui:latest

or

docker pull registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:latest

Step Four: Run the Docker Image for NginxWebUI

Create and start a Docker container for NginxWebUI using the following command:

docker run -itd \
  -v /home/nginxWebUI:/home/nginxWebUI \
  -e BOOT_OPTIONS="--server.port=8080" \
  --privileged=true \
  --net=host \
  cym1102/nginxwebui:latest

Please note that you need to use the --net=host parameter to map all ports on the host machine, as the internal Nginx may use any port.

Also, you need to map the /home/nginxWebUI:/home/nginxWebUI directory. This directory contains all the project data files, including the database, Nginx configuration files, logs, certificates, etc. This directory ensures that project data is not lost when the image is upgraded. Be sure to back it up.

In the -e BOOT_OPTIONS parameter, you can fill in the Java startup parameters. Through this parameter, you can change the port number. --server.port is the port to be used. If not specified, it will start on port 8080 by default.

Logs are stored by default in /home/nginxWebUI/log/nginxWebUI.log.

You can also use docker-compose to start NginxWebUI. The configuration file is as follows:

version: "3.2"
services:
  nginxWebUi-server:
    image: cym1102/nginxwebui:latest
    volumes:
      - type: bind
        source: "/home/nginxWebUI"
        target: "/home/nginxWebUI"
    environment:
      BOOT_OPTIONS: "--server.port=8080"
    privileged: true
    network_mode: "host"

Step Five: Log in to the Website for Configuration

Access IP:8080 in your browser. When you open this address for the first time, you will be asked to initialize the administrator account.

In the HTTP parameter configuration, you can configure the HTTP items of Nginx and perform HTTP forwarding.

In the TCP parameter configuration, configure the stream project parameters of Nginx.

In the reverse proxy, configure the reverse proxy function of Nginx, i.e., the server item function. You can enable SSL, upload PEM files and key files directly from the web page, or use the certificates applied for in the system. You can directly enable HTTP to jump to HTTPS and enable the HTTP2 protocol.

In the load balancing, you can configure the load balancing function of Nginx, i.e., the upstream item function. In the reverse proxy management, you can select the proxy target as the configured load balancing.

In the HTML static file upload, you can directly upload the HTML zip file to the specified path. After uploading, you can directly use it in the reverse proxy, eliminating the step of uploading HTML files in Linux.

In the certificate management, you can add certificates, issue and renew them. After enabling the scheduled renewal, the system will automatically renew the certificates that are about to expire. Note: The issuance of certificates uses the DNS mode of acme.sh and needs to be used in conjunction with Aliyun's aliKey and aliSecret. Please apply for aliKey and aliSecret in advance.

Backup file management, here you can see the backup history versions of nginx.cnf. When Nginx encounters an error, you can choose to roll back to a certain historical version.

Finally, generate the conf file, you can further manually modify it here. After confirming that the modifications are correct, you can overwrite the local conf file and perform validation and restart. You can choose to generate a single nginx.conf file or put each configuration file separately in conf.d according to the domain name.

Supports remote server management. If you have multiple Nginx servers, you can deploy NginxWebUI on all of them, then log in to one of them, add the IP and username and password of other servers in remote management, and manage all Nginx servers on one machine. Provides a one-click synchronization function, you can synchronize the data configuration and certificate files of a certain server to other servers.

If you need to call the functions of NginxWebUI through the API, you can visit IP:8080/doc.html to view the smart-doc interface page.

If you forget the login password or did not save the two-step verification QR code, you can reset the password and turn off the two-step verification by following the steps below.

  1. Stop the docker container from running.
  2. Use the password recovery parameter to run nginxWebUI.jar, you need to download nginxWebUI.jar separately to run this command.
mkdir /home/nginxWebUI/ 
wget -O /home/nginxWebUI/nginxWebUI.jar http://file.nginxwebui.cn/nginxWebUI-

3.6.5.jar
java -jar nginxWebUI.jar --project.home=/home/nginxWebUI/ --project.findPass=true

--project.home is the directory where the project files are located. When using a docker container, it is the mapped directory.

--project.findPass is whether to print the username and password.

After successful operation, you can reset and print all usernames and passwords and turn off two-step verification.

Tag:Configure, NginxWebUI, Docker

Original link:http://enblog.fuyiran.link/Technology/11.html

Copyright: All posts on this blog, unless otherwise stated, are published using theCC BY-NC-SA 4.0 license agreement. Please indicate the source for reprinting Fu Speaking (enblog.fuyiran.link)

Add a new comment.