This issue recommends an Nginx interface configuration tool – nginxWebUI.
nginxWebUI is a tool for graphical management of nginx configuration. You can use web pages to quickly configure nginx functions. Including http protocol forwarding, tcp protocol forwarding, reverse proxy, load balancing, static html server, ssl certificate automatic application, renewal, configuration, etc. After configuration, NginX. conf file can be created and generated, and nginx can be controlled to use this file to start and reload, to complete the graphical control of nginx closed loop.
Features
- Configuration file data : the cumbersome configuration file modification operation of nginx is changed to the addition, deletion, correction and check of data, the maximum liberation of labor, no longer looking for modification tutorials.
- Cluster Management : Manage all nginx cluster server configuration files on one machine, modify and restart them in a unified manner, and no longer need to log in to each server frequently.
- One-click certificate application and automatic renewal : One click generates an ssl certificate for free and binds the domain name, which can be automatically renewed before the certificate expires to ensure the https security and continuity of the website.
- Powerful nginx log parsing : You can configure the nginx log generation format with one click, and perform graphical analysis, and fully understand the visitor data and background service running status.
- docker container deployment : Integrate nginx and nginxWebUI into a docker image to perfectly create a nginx running package with a graphical interface, without conflict with other programs on the server.
- data import and export : The data of the whole site can be exported to a file, which is convenient for program migration and redeployment.
- Direct upload of web pages and certificates : The web pages and certificates required by nginx can be directly uploaded to the web page, facilitating the establishment of one-stop service, and abandoning the ssh client in the whole process.
- Powerful backup management mechanism : Every time you replace the nginx.conf file, a backup will be generated, ensuring that the operation error can be rolled back anytime and anywhere, and there is no problem with the hand.
Technical Description
This project is a Solon-based web system, and the database uses h2, so there is no need to install any database on the server.
The system applies for the certificate through Let’s encrypt and uses the acme.sh script to automatically apply for and renew the certificate. The certificate that is renewed will be renewed at 2 am every day.
When adding tcp/ip forwarding configuration support, some earlier versions of nginx may need to be recompiled to use the stream module by adding the -with-stream parameter, but under ubuntu 18.04, nginx in the official software library already comes with the stream module and does not need to be recompiled. If the tcp forwarding item is configured in the system, ngx_stream_module.so is automatically introduced. If it is not enabled, it is not introduced to optimize ngnix profiles to the maximum extent.
Interface Description
Open http://ip:8080 to go to the home page.
Login page, the first time it is opened, it will ask to initialize the administrator account.
After entering the system, you can add and modify the administrator account in the administrator management.
In the http parameter configuration, you can configure the http project of nginx to carry out http forwarding. By default, several common configurations are given, and other required configurations can be freely added, deleted, modified and checked. You can select to enable log tracking and generate log files.
In TCP parameter configuration, you can configure the steam project parameters of nginx for tcp forwarding.
In the reverse proxy, you can configure the server function of nginx, enable the ssl function, upload pem and key files directly from the web page, or use the certificate applied in the system, enable the http and https function directly. You can also enable http2.
The load balancing function of nginx can be configured in the load balancing function. In the reverse proxy management function, you can select the agent target as the configured load balancing function.
In certificate management, you can add, issue, and renew certificates. After periodic renewal is enabled, the system automatically renews certificates that are about to expire.
Backup file management, here you can see the backup history version of nginx.cnf, nginx error can choose to roll back to a history version.
The final conf file can be generated, and further manual modification can be performed here. After confirming the modification, the local conf file can be overwritten, and the verification and restart can be performed. You can choose to generate a single nginx.conf file or separate the configuration files by domain name under conf.d.
Remote server management: If there are multiple nginx servers, you can deploy them on the nginxWebUI, then log in to one of them, add the ip addresses and user names and passwords of other servers in the remote management, you can manage all nginx servers on one machine.
The one-click synchronization function allows you to synchronize the data configuration and certificate files of a server to other servers.
This system provides http interface call, as long as open
Page http://xxx.xxx.xxx.xxx:8080/doc.html to view the smat – doc interface.
Interface invocation needs to add token in header, and the acquisition of token needs to be managed by the administrator, open the user’s interface invocation permission, and then invoke the user name and password to obtain the token interface, so as to obtain the token. The global token is then set in knife4j’s document management.
Installation tutorial
jar Installation instructions:
Note: This project needs to run system commands under the root user, which is very easy to be exploited by hackers. Please change the password to a complex password
.
Take Ubuntu as an example:
1 Install the java runtime environment and nginx
Ubuntu:
apt install openjdk-8-jdk
sudo apt install nginx
Centos:
yum install java-1.8.0-openjdk
yum install nginx
Windows:
https://www.oracle.com/java/technologies/downloads/
Configuring the JAVA runtime environment
JAVA_HOME : JDK installation directory
Path : JDK installation directory \bin
Restart the computer
2 Download the latest release jar
If there is a new version, just modify the version in the path.
Linux: wget -O /home/nginxWebUI/nginxWebUI.jar http: / / file. Nginxwebui. Cn/nginxwebui - 3.2.8. Jar < / span >
Windows: Download http: / / file. Nginxwebui. Cn/nginxwebui - 3.2.8. Jar < / span > < / code > < / pre >
3 Start the program
Linux: nohup java -jar -Dfile.encoding=UTF-8 /home/nginxWebUI/nginxWebUI.jar --server.port=8080 --project.home=/home/nginxWebUI/ > /dev/null &
Windows: java -jar -Dfile.encoding=UTF-8 D:/home/nginxWebUI/nginxWebUI.jar --server.port=8080 --project.home=D:/home/nginxWebUI/
Parameter Description (both mandatory) :
–server.port occupies a port and starts on port 8080 by default
–project.home project configuration file directory, storing database files, certificate files, logs, etc. The default is /home/nginxwebuis/
.
–spring.database.type=mysql Use another database, do not specify to use local h2, optional mysql
–spring.datasource.url=
JDBC: mysql: / / IP: port/nginxwebui database url < / p >
< p data – track = “62” > — spring. The datasource. The username = root database user < / p >
< p data – track = “63” > — spring. The datasource. Password = pass database password < / p >
Notice that the Linux command adds an & at the end; Number, indicating that the project is running in the background
docker installation instructions
This project made docker image, including nginx and nginxWebUI, integrated management and operation of nginx.
1 Install docker container environment
ubuntu:
apt install docker.io
centos:
yum install docker
2 Download the image
docker pull cym1102/nginxwebui:latest
3 Start the container
docker run -itd -v /home/nginxWebUI:/home/nginxWebUI -e BOOT_OPTIONS="--server.port=8080" --privileged=true --net=host cym1102/nginxwebui:latest
Note:
When starting the container, use the –net=host parameter to map the local port directly, because the internal nginx may use any port, so you must map all the ports on the local port
The container needs to map the path
/ home/nginxWebUI: / home/nginxWebUI, this path for a project all data files, including database, nginx configuration files, log, certificate, etc., and updates the mirror, this directory to ensure that project data is not lost. Please note backup-e BOOT_OPTIONS parameter can fill the java startup parameter, you can use this parameter to modify the port number, “–server.port occupies the port “, do not fill the default port 8080 start
Logs are stored by default
/home/nginxWebUI/log/nginxWebUI.log
—END—
Open Source protocol: MulanPSL-1.0