Yet another WebUI for Nginx https://nginxui.com
Find a file
2024-07-30 15:17:43 +08:00
.github chore: add target branch for dependabot 2024-07-30 02:24:17 +09:00
.idea refactor: single-file versioning 2024-07-27 19:44:16 +09:00
api docs: update docs about insecure skip verify 2024-07-30 15:17:43 +08:00
app fix: uncontrolled data used in path expression 2024-07-30 15:07:14 +08:00
cmd/generate feat: add notifications for renew certs #192 2023-12-05 14:35:58 +08:00
docs docs: update docs about insecure skip verify 2024-07-30 15:17:43 +08:00
internal docs: update docs about insecure skip verify 2024-07-30 15:17:43 +08:00
model enhance: add settings for skip tls cert check 2024-07-30 15:10:02 +08:00
query feat: deploy config to remote nodes #359 2024-07-26 13:53:38 +08:00
resources fix(resources): remove trailing .conf in default nginx stream block 2024-07-22 01:59:22 +08:00
router feat: deploy config to remote nodes #359 2024-07-26 13:53:38 +08:00
settings enhance: add settings for skip tls cert check 2024-07-30 15:10:02 +08:00
template fix(template): $proxy_add_forwarded not defined in reverse_proxy.conf 2024-07-08 10:12:54 +08:00
test fix: safety text validate rule #383 2024-05-21 10:39:11 +08:00
.air.toml fix: build ldflags 2024-05-06 17:37:50 +08:00
.dockerignore refactor: project directory structure 2023-11-26 18:59:12 +08:00
.editorconfig enhance: chat with LLM 2024-05-02 12:49:01 +08:00
.gitignore fix: missing provider in dns credential viewer 2024-06-10 20:34:55 +08:00
app.example.ini feat: login 2fa 2024-07-23 17:28:13 +08:00
CONTRIBUTING.md chore: Create CONTRIBUTING.md 2023-02-16 22:41:02 +08:00
demo.Dockerfile fix(demo): recreate access.log and error.log as regular files 2024-06-18 19:00:47 +08:00
docker-compose-demo.yml chore: update demo 2023-05-18 21:16:32 +08:00
Dockerfile feat: use env to predefine admin user #214 2024-05-06 23:50:32 +08:00
gen.sh feat: sync certificates to remote server #293, #363, #411 2024-06-18 17:39:05 +08:00
go.mod chore(deps): bump github.com/sashabaranov/go-openai 2024-07-29 10:44:10 +00:00
go.sum chore(deps): bump github.com/sashabaranov/go-openai 2024-07-29 10:44:10 +00:00
install.sh chore: replace ghproxy.com with mirror.ghproxy.com 2023-12-21 11:01:41 +08:00
lego-config.sh chore(deps): update dns challenges toml 2023-11-27 19:23:23 +08:00
LICENSE Create LICENSE 2022-03-04 13:52:23 +08:00
main.go enhance(upgrader): restart main proc manually and gracefully 2024-07-27 10:59:32 +08:00
nginx-ui.service fix install script 2022-02-21 14:03:46 +08:00
README-es.md fix: proxy url query unescape issue #377 2024-05-08 19:00:32 +08:00
README-vi_VN.md fix: proxy url query unescape issue #377 2024-05-08 19:00:32 +08:00
README-zh_CN.md fix: proxy url query unescape issue #377 2024-05-08 19:00:32 +08:00
README-zh_TW.md fix: proxy url query unescape issue #377 2024-05-08 19:00:32 +08:00
README.md chore: add translated status on readme.md 2024-07-26 23:18:05 +08:00

Nginx UI Logo

Nginx UI

Yet another Nginx Web UI, developed by 0xJacky and Hintay.

Build and Publish GitHub license Release Version GitHub Star GitHub Fork Repo Size GitHub Fork

Docker Stars Docker Pulls Image Size

Translated Status

Documentation

To check out docs, visit nginxui.com.

Stargazers over time

Stargazers over time

English | Español | 简体中文 | 繁體中文 | Tiếng Việt

Table of Contents
  1. About The Project
  2. Getting Started
  3. Manual Build
  4. Script for Linux
  5. Example of Nginx Reverse Proxy Configuration
  6. Contributing
  7. License

About The Project

Dashboard

Demo

URLhttps://demo.nginxui.com

  • Usernameadmin
  • Passwordadmin

Features

  • Online statistics for server indicators such as CPU usage, memory usage, load average, and disk usage.
  • Online ChatGPT Assistant
  • One-click deployment and automatic renewal Let's Encrypt certificates.
  • Online editing websites configurations with our self-designed NgxConfigEditor which is a user-friendly block editor for nginx configurations or Ace Code Editor which supports highlighting nginx configuration syntax.
  • Online view Nginx logs
  • Written in Go and Vue, distribution is a single executable binary.
  • Automatically test configuration file and reload nginx after saving configuration.
  • Web Terminal
  • Dark Mode
  • Responsive Web Design

Internationalization

  • English
  • Simplified Chinese
  • Traditional Chinese

We welcome translations into any language.

Built With

Getting Started

Before Use

The Nginx UI follows the Debian web server configuration file standard. Created site configuration files will be placed in the sites-available folder that under the Nginx configuration folder (auto-detected). The configuration files for an enabled site will create a soft link to the sites-enabled folder. You may need to adjust the way the configuration files are organised.

For non-Debian (and Ubuntu) systems, you may need to change the contents of the nginx.conf configuration file to the Debian style as shown below.

http {
	# ...
	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}

For more information: debian/conf/nginx.conf

Installation

Nginx UI is available on the following platforms:

  • macOS 11 Big Sur and later (amd64 / arm64)
  • Linux 2.6.23 and later (x86 / amd64 / arm64 / armv5 / armv6 / armv7)
    • Including but not limited to Debian 7 / 8, Ubuntu 12.04 / 14.04 and later, CentOS 6 / 7, Arch Linux
  • FreeBSD
  • OpenBSD
  • Dragonfly BSD
  • Openwrt

You can visit latest release to download the latest distribution, or just use installation scripts for Linux.

Usage

In the first runtime of Nginx UI, please visit http://<your_server_ip>:<listen_port>/install in your browser to complete the follow-up configurations.

From Executable

Run Nginx UI in Terminal

nginx-ui -config app.ini

Press Control+C in the terminal to exit Nginx UI.

Run Nginx UI in Background

nohup ./nginx-ui -config app.ini &

Stop Nginx UI with the follow command.

kill -9 $(ps -aux | grep nginx-ui | grep -v grep | awk '{print $2}')

With Systemd

If you are using the installation script for Linux, the Nginx UI will be installed as nginx-ui service in systemd. Please use the systemctl command to control it.

Start Nginx UI

systemctl start nginx-ui

Stop Nginx UI

systemctl stop nginx-ui

Restart Nginx UI

systemctl restart nginx-ui

With Docker

Our docker image uozi/nginx-ui:latest is based on the latest nginx image and can be used to replace the Nginx on the host. By publishing the container's port 80 and 443 to the host, you can easily make the switch.

Note
  1. When using this container for the first time, ensure that the volume mapped to /etc/nginx is empty.
  2. If you want to host static files, you can map directories to container.
Deploy with Docker
  1. Install Docker.

  2. Then deploy nginx-ui like this:

docker run -dit \
  --name=nginx-ui \
  --restart=always \
  -e TZ=Asia/Shanghai \
  -v /mnt/user/appdata/nginx:/etc/nginx \
  -v /mnt/user/appdata/nginx-ui:/etc/nginx-ui \
  -p 8080:80 -p 8443:443 \
  uozi/nginx-ui:latest
  1. When your docker container is running, Log in to nginx-ui panel with http://<your_server_ip>:8080/install.
Deploy with Docker-Compose
  1. Install Docker-Compose.

  2. Create a docker-compose.yml file like this:

version: '3.3'
services:
    nginx-ui:
        stdin_open: true
        tty: true
        container_name: nginx-ui
        restart: always
        environment:
            - TZ=Asia/Shanghai
        volumes:
            - '/mnt/user/appdata/nginx:/etc/nginx'
            - '/mnt/user/appdata/nginx-ui:/etc/nginx-ui'
            - '/var/www:/var/www'
        ports:
            - 8080:80
            - 8443:443
        image: 'uozi/nginx-ui:latest'
  1. Then creat your container by:
docker-compose up -d
# If using docker-compose-plugin
docker compose up -d
  1. When your docker container is running, Log in to nginx-ui panel with http://<your_server_ip>:8080/install.

Manual Build

On platforms that do not have an official build version, they can be built manually.

Prerequisites

  • Make

  • Golang 1.22+

  • node.js 21+

    npx browserslist@latest --update-db
    

Build Frontend

Please execute the following command in app directory.

pnpm install
pnpm build

Build Backend

Please build the app first, and then execute the following command in the project root directory.

go build -tags=jsoniter -ldflags "$LD_FLAGS -X 'github.com/0xJacky/Nginx-UI/settings.buildTime=$(date +%s)'" -o nginx-ui -v main.go

Script for Linux

Basic Usage

Install and Upgrade

bash <(curl -L -s https://raw.githubusercontent.com/0xJacky/nginx-ui/master/install.sh) install

The default listening port is 9000, and the default HTTP Challenge port is 9180. If there is a port conflict, please modify /usr/local/etc/nginx-ui/app.ini manually, then use systemctl restart nginx-ui to reload the Nginx UI service.

Remove Nginx UI, except configuration and database files

bash <(curl -L -s https://raw.githubusercontent.com/0xJacky/nginx-ui/master/install.sh) remove

More Usage

bash <(curl -L -s https://raw.githubusercontent.com/0xJacky/nginx-ui/master/install.sh) help

Example of Nginx Reverse Proxy Configuration

server {
    listen          80;
    listen          [::]:80;

    server_name     <your_server_name>;
    rewrite ^(.*)$  https://$host$1 permanent;
}

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen  443       ssl;
    listen  [::]:443  ssl;
    http2   on;

    server_name         <your_server_name>;

    ssl_certificate     /path/to/ssl_cert;
    ssl_certificate_key /path/to/ssl_cert_key;

    location / {
        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   $scheme;
        proxy_http_version  1.1;
        proxy_set_header    Upgrade             $http_upgrade;
        proxy_set_header    Connection          $connection_upgrade;
        proxy_pass          http://127.0.0.1:9000/;
    }
}

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is provided under a GNU Affero General Public License v3.0 license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.