From 2a074ba50f5564179ddea3574b5cc3c5a349f0ab Mon Sep 17 00:00:00 2001 From: Jacky Date: Mon, 29 Mar 2021 10:32:25 +0800 Subject: [PATCH] Update README.md --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 67c19e14..d947efdb 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,48 @@ Yet another Nginx Web UI Version: 0.1 +# 使用前注意 +Nginx UI 遵循 nginx 的标准,创建的网站配置文件位于 nginx 配置目录(自动检测)下的 sites-available 目录, +启用后的网站将会创建一份软连接到 sites-enabled 目录中。因此,您可能需要调整配置文件的组织方式。 + # 安装 1. 克隆项目 2. 运行 install.sh 3. 添加配置文件到 nginx ``` +server { + listen 80; + listen [::]:80; + server_name ; + rewrite ^(.*)$ https://$host$1 permanent; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name ; + + ssl_certificate /path/to/ssl_cert; + ssl_certificate_key /path/to/ssl_cert_key; + + root /path/to/nginx-ui-frontend/dist; + index index.html; + + location /api { + rewrite /api/(.+) /$1 break; + proxy_pass http://127.0.0.1:9000; + } + + location /ws/ { + proxy_set_header Host $host; + proxy_set_header X-Real_IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr:$remote_port; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + proxy_pass http://127.0.0.1:9000/; + } +} ```