nginxWebUI可视化配置,nginx 网页配置工具(Web page configuration tool, webinngx)

功能说明

nginxWebUI 是一款图形化管理 nginx 配置得工具,可以使用网页来快速配置 nginx 的各项功能,包括 http 协议转发,tcp 协议转发,反向代理,负载均衡,静态 html 服务器,ssl 证书自动申请、续签、配置等,配置好后可一建生成 nginx.conf 文件,同时可控制 nginx 使用此文件进行启动与重载,完成对 nginx 的图形化控制闭环.

nginxWebUI 也可管理多个 nginx 服务器集群,随时一键切换到对应服务器上进行 nginx 配置,也可以一键将某台服务器配置同步到其他服务器,方便集群管理.

nginx 本身功能复杂,nginxWebUI 并不能涵盖 nginx 所有功能,但能覆盖 nginx 日常 90% 的功能使用配置,平台没有涵盖到的 nginx 配置项,可以使用自定义参数模板,在 conf 文件中生成配置独特的参数。

部署此项目后,配置 nginx 再也不用上网各种搜索配置代码,再也不用手动申请和配置 ssl 证书,只需要在本项目中进行增删改查就可方便的配置和启动 nginx。

技术说明

本项目是基于 solon 的 web 系统,数据库使用 h2, 因此服务器上不需要安装任何数据库

本系统通过 Let’s encrypt 申请证书,使用 acme.sh 脚本进行自动化申请和续签,开启续签的证书将在每天凌晨 2 点进行续签,只有超过 50 天的证书才会进行续签。只支持在 linux 下签发证书.

添加 tcp/ip 转发配置支持时,一些低版本的 nginx 可能需要重新编译,通过添加–with-stream 参数指定安装 stream 模块才能使用,但在 ubuntu 18.04 下,官方软件库中的 nginx 已经带有 stream 模块,不需要重新编译。本系统如果配置了 tcp 转发项的话,会自动引入 ngx_stream_module.so 的配置项,如果没有开启则不引入,最大限度优化 ngnix 配置文件.

jar 安装说明

以 Ubuntu 操作系统为例,

注意:本项目需要在 root 用户下运行系统命令,极容易被黑客利用,请一定修改密码为复杂密码

1. 安装 java 运行环境和 nginx

Ubuntu:

1 apt update
2 apt install openjdk-11-jdk
3 apt install nginx

Centos:

yum install java-11-openjdk
yum install nginx

Windows:

1 下载JDK安装包 https://www.oracle.com/java/technologies/downloads/
2 下载nginx http://nginx.org/en/download.html
3 配置JAVA运行环境 
4 JAVA_HOME : JDK安装目录
5 Path : JDK安装目录\bin
6 重启电脑

2. 下载最新版发行包 jar

1 Linux: wget -O /home/nginxWebUI/nginxWebUI.jar http://file.nginxwebui.cn/nginxWebUI-3.1.8.jar
2 
3 Windows: 直接使用浏览器下载 http://file.nginxwebui.cn/nginxWebUI-3.1.8.jar

有新版本只需要修改路径中的版本即可

3. 启动程序

1 Linux: nohup java -jar -Dfile.encoding=UTF-8 /home/nginxWebUI/nginxWebUI.jar --server.port=8080 --project.home=/home/nginxWebUI/ > /dev/null &
2 
3 Windows: java -jar -Dfile.encoding=UTF-8 D:/home/nginxWebUI/nginxWebUI.jar --server.port=8080 --project.home=D:/home/nginxWebUI/

参数说明 (都是非必填)

–server.port 占用端口,默认以 8080 端口启动

–project.home 项目配置文件目录,存放数据库文件,证书文件,日志等,默认为 /home/nginxWebUI/

–spring.database.type=mysql 使用其他数据库,不填为使用本地 h2 数据库,可选 mysql

–spring.datasource.url=jdbc:mysql://ip:port/nginxwebui 数据库 url

–spring.datasource.username=root 数据库用户

–spring.datasource.password=pass 数据库密码

注意 Linux 命令最后加一个 & 号,表示项目后台运行

docker 安装说明

本项目制作了 docker 镜像,支持 x86/x86_64/arm64/arm v7 平台,同时包含 nginx 和 nginxWebUI 在内,一体化管理与运行 nginx.

1. 安装 docker 容器环境

Ubuntu:

apt install docker.io

Centos:

yum install docker

2. 拉取镜像:

docker pull cym1102/nginxwebui:latest

3. 启动容器:

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

注意:

  • 启动容器时请使用 –net=host 参数,直接映射本机端口,因为内部 nginx 可能使用任意一个端口,所以必须映射本机所有端口.
  • 容器需要映射路径 /home/nginxWebUI:/home/nginxWebUI, 此路径下存放项目所有数据文件,包括数据库,nginx 配置文件,日志,证书等,升级镜像时,此目录可保证项目数据不丢失。请注意备份.
  • -e BOOT_OPTIONS 参数可填充 java 启动参数,可以靠此项参数修改端口号,–server.port 为占用端口参数,不填默认以 8080 端口启动
  • 日志默认存放在 /home/nginxWebUI/log/nginxWebUI.log

更新说明

相关链接

  • nginxWebUI 的详细介绍:点击查看
  • nginxWebUI 的下载地址:点击下载
————————

Function description

Nginxwebui is a tool for graphical management of nginx configuration. You can use web pages to quickly configure various functions of nginx, including HTTP protocol forwarding, TCP protocol forwarding, reverse proxy, load balancing, static HTML server, automatic application, renewal and configuration of SSL certificate. After configuration, nginx can be built Conf file, which can control nginx at the same time. Use this file to start and reload, and complete the graphical control loop of nginx

Nginx Web UI can also manage multiple nginx server clusters. You can switch to the corresponding server for nginx configuration at any time, or you can synchronize the configuration of a server to other servers at one click to facilitate cluster management

Nginx itself has complex functions. The nginxwebui cannot cover all functions of nginx, but it can cover 90% of the daily function use configuration of nginx. For nginx configuration items not covered by the platform, you can use a user-defined parameter template to generate unique parameters in the conf file.

After this project is deployed, nginx can be configured without searching for configuration codes on the Internet or manually applying for and configuring SSL certificates. You only need to add, delete, modify and check in this project to easily configure and start nginx.

Technical description

This project is a solo based web system. The database uses H2, so there is no need to install any database on the server

The system applies for certificates through let’s encrypt and uses acme The SH script will automatically apply for and renew. The certificates that have been renewed will be renewed at 2 a.m. every day. Only certificates that have been renewed for more than 50 days will be renewed. It only supports issuing certificates under Linux

When adding TCP / IP forwarding configuration support, some lower versions of nginx may need to be recompiled. The stream module can be installed only by adding the – with stream parameter. However, under Ubuntu 18.04, nginx in the official software library already has a stream module and does not need to be recompiled. If the system is configured with TCP forwarding item, NGX will be introduced automatically_ stream_ module. If the configuration item of so is not enabled, it will not be introduced to optimize the ngnix configuration file to the greatest extent

Jar installation instructions

Take the Ubuntu operating system as an example,

Note: this project needs to run system commands under the root user, which is very easy to be used by hackers. Please change the password to complex password

1. Install Java runtime environment and nginx

Ubuntu:

1 apt update
2 apt install openjdk-11-jdk
3 apt install nginx

Centos:

yum install java-11-openjdk
yum install nginx

Windows:

1 下载JDK安装包 https://www.oracle.com/java/technologies/downloads/
2 下载nginx http://nginx.org/en/download.html
3 配置JAVA运行环境 
4 JAVA_HOME : JDK安装目录
5 Path : JDK安装目录\bin
6 重启电脑

2. Download the latest release package jar

1 Linux: wget -O /home/nginxWebUI/nginxWebUI.jar http://file.nginxwebui.cn/nginxWebUI-3.1.8.jar
2 
3 Windows: 直接使用浏览器下载 http://file.nginxwebui.cn/nginxWebUI-3.1.8.jar

If there is a new version, you only need to modify the version in the path

3. Start up procedure

1 Linux: nohup java -jar -Dfile.encoding=UTF-8 /home/nginxWebUI/nginxWebUI.jar --server.port=8080 --project.home=/home/nginxWebUI/ > /dev/null &
2 
3 Windows: java -jar -Dfile.encoding=UTF-8 D:/home/nginxWebUI/nginxWebUI.jar --server.port=8080 --project.home=D:/home/nginxWebUI/

Parameter description (all non mandatory)

–server. Port takes up the port. It starts with port 8080 by default

–project. Home project configuration file directory, which stores database files, certificate files, logs, etc. the default is / home / nginxwebui/

–spring. database. Type = MySQL uses other databases. If it is not filled in, it uses the local H2 database. MySQL is optional

–spring.datasource.url=jdbc:mysql://ip:port/nginxwebui 数据库 url

–spring.datasource.username=root 数据库用户

–spring.datasource.password=pass 数据库密码

Note that the Linux command ends with a & amp; No. indicates that the project is running in the background

docker 安装说明

In this project, a docker image is produced, which supports x86 / x86_ 64 / arm64 / arm V7 platform, 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. Pull 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

be careful:

  • When starting the container, please use the — net = host parameter to directly map the local port. Because any port may be used by internal nginx, all local ports must be mapped
  • The container needs to map the path / home / nginxwebui: / home / nginxwebui, which stores all data files of the project, including database, nginx configuration file, log, certificate, etc. when upgrading the image, this directory can ensure that the project data is not lost. Please pay attention to backup
  • -e BOOT_ The options parameter can be used to fill in the Java startup parameter, which can be used to modify the port number, — server Port is the occupied port parameter. If it is not filled in, it will be started on port 8080 by default
  • 日志默认存放在 /home/nginxWebUI/log/nginxWebUI.log

Update description

Related links

  • Detailed introduction of nginx Web UI: Click to view
  • Download address of nginxwebui: click download