Yet another Nginx Web UI
Nginx 網路管理介面,由 0xJacky、Hintay 和 Akino 開發。
English | Español | 简体中文 | 繁體中文
我們歡迎您將專案翻譯成任何語言。
Nginx UI 遵循 Debian 的網頁伺服器設定檔標準。建立的網站設定檔將會放置於 Nginx 設定資料夾(自動偵測)下的 sites-available
中,啟用後的網站將會建立一份設定檔軟連結檔到 sites-enabled
資料夾。您可能需要提前調整設定檔的組織方式。
對於非 Debian (及 Ubuntu) 作業系統,您可能需要將 nginx.conf
設定檔中的內容修改為如下所示的 Debian 風格。
http {
# ...
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
更多資訊請參閱:debian/conf/nginx.conf
Nginx UI 可在以下作業系統中使用:
您可以在 最新釋出 (latest release) 中下載最新版本,或使用 Linux 安裝指令。
第一次執行 Nginx UI 時,請在網頁瀏覽器中存取 http://<your_server_ip>:<listen_port>
完成後續設定。
在終端中執行 Nginx UI
nginx-ui -config app.ini
在終端使用 Control+C
結束 Nginx UI。
在背景執行 Nginx UI
nohup ./nginx-ui -config app.ini &
使用以下命令停止 Nginx UI。
kill -9 $(ps -aux | grep nginx-ui | grep -v grep | awk '{print $2}')
如果你使用的是 Linux 安裝指令,Nginx UI 將作為 nginx-ui
守護行程安裝在 systemd 中。請使用 systemctl
指令控制。
啟動 Nginx UI
systemctl start nginx-ui
停止 Nginx UI
systemctl stop nginx-ui
重啟 Nginx UI
systemctl restart nginx-ui
您可以在 docker 中使用我們提供的 uozi/nginx-ui:latest
映象,此映象基於 nginx:latest
建置。您可以直接將其監聽到 80 和 443 埠以取代宿主機上的 Nginx。
注意:對映到 /etc/nginx
的資料夾應是一個空資料夾。
Docker 範例
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 \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 8080:80 -p 8443:443 \
uozi/nginx-ui:latest
對於沒有官方建置版本的作業系統,可以嘗試手動建置。
Make
Golang 1.23+
node.js 21+
npx browserslist@latest --update-db
請在 app
資料夾中執行以下命令。
pnpm install
pnpm build
請先完成前端編譯,再回到專案的根目錄執行以下命令。
go generate
go build -tags=jsoniter -ldflags "$LD_FLAGS -X 'github.com/0xJacky/Nginx-UI/settings.buildTime=$(date +%s)'" -o nginx-ui -v main.go
安裝或升級
bash -c "$(curl -L https://raw.githubusercontent.com/0xJacky/nginx-ui/main/install.sh)" @ install
一鍵安裝指令預設的監聽連接埠為 9000
,HTTP Challenge 埠預設為 9180
,如果出現連接埠衝突請修改 /usr/local/etc/nginx-ui/app.ini
,並使用 systemctl restart nginx-ui
重啟 Nginx UI 守護行程。
解除安裝 Nginx UI 但保留設定和資料庫檔案
bash -c "$(curl -L https://raw.githubusercontent.com/0xJacky/nginx-ui/main/install.sh)" @ remove
bash -c "$(curl -L https://raw.githubusercontent.com/0xJacky/nginx-ui/main/install.sh)" @ help
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/;
}
}
貢獻使開源社群成為學習、啟發和創造的絕佳場所。我們非常感謝您所做的任何貢獻。
如果您有讓這個專案變得更強的建議,歡迎 fork 這個程式庫 (repository) 並建立一個 Pull Request。您也可以建立一個帶有 enhancement
(加強)標籤的 Issue。最後,不要忘記給我們的專案點個 Star!再次感謝!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)此專案基於 GNU Affero Public License v3.0 (AGPLv3) 授權條款,請參閱 LICENSE 檔案。透過使用、散佈或對本專案做出貢獻,表明您已同意本授權條款的條款和條件。