Browse Source

chore: update docs

0xJacky 3 days ago
parent
commit
a157df84a7

+ 1 - 0
docs/.vitepress/config/en.ts

@@ -19,6 +19,7 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
             { text: 'What is Nginx UI?', link: '/guide/about' },
             { text: 'What is Nginx UI?', link: '/guide/about' },
             { text: 'Getting Started', link: '/guide/getting-started' },
             { text: 'Getting Started', link: '/guide/getting-started' },
             { text: 'Install with Homebrew', link: '/guide/install-homebrew' },
             { text: 'Install with Homebrew', link: '/guide/install-homebrew' },
+            { text: 'Install with Winget', link: '/guide/install-winget' },
             { text: 'Install Script', link: '/guide/install-script-linux' }
             { text: 'Install Script', link: '/guide/install-script-linux' }
           ]
           ]
         },
         },

+ 1 - 0
docs/.vitepress/config/zh_CN.ts

@@ -24,6 +24,7 @@ export const zhCNConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
             { text: '何为 Nginx UI?', link: '/zh_CN/guide/about' },
             { text: '何为 Nginx UI?', link: '/zh_CN/guide/about' },
             { text: '即刻开始', link: '/zh_CN/guide/getting-started' },
             { text: '即刻开始', link: '/zh_CN/guide/getting-started' },
             { text: '使用 Homebrew 安装', link: '/zh_CN/guide/install-homebrew' },
             { text: '使用 Homebrew 安装', link: '/zh_CN/guide/install-homebrew' },
+            { text: '使用 Winget 安装', link: '/zh_CN/guide/install-winget' },
             { text: '安装脚本', link: '/zh_CN/guide/install-script-linux' }
             { text: '安装脚本', link: '/zh_CN/guide/install-script-linux' }
           ]
           ]
         },
         },

+ 1 - 0
docs/.vitepress/config/zh_TW.ts

@@ -24,6 +24,7 @@ export const zhTWConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
             { text: '何為 Nginx UI?', link: '/zh_TW/guide/about' },
             { text: '何為 Nginx UI?', link: '/zh_TW/guide/about' },
             { text: '即刻開始', link: '/zh_TW/guide/getting-started' },
             { text: '即刻開始', link: '/zh_TW/guide/getting-started' },
             { text: '使用 Homebrew 安裝', link: '/zh_TW/guide/install-homebrew' },
             { text: '使用 Homebrew 安裝', link: '/zh_TW/guide/install-homebrew' },
+            { text: '使用 Winget 安裝', link: '/zh_TW/guide/install-winget' },
             { text: '安裝指令碼', link: '/zh_TW/guide/install-script-linux' }
             { text: '安裝指令碼', link: '/zh_TW/guide/install-script-linux' }
           ]
           ]
         },
         },

+ 1 - 0
docs/guide/getting-started.md

@@ -33,6 +33,7 @@ information: [debian/conf/nginx.conf](https://salsa.debian.org/nginx-team/nginx/
 We provide several installation methods to suit different needs:
 We provide several installation methods to suit different needs:
 
 
 - **macOS/Linux**: Use [Homebrew](./install-homebrew) for the easiest installation
 - **macOS/Linux**: Use [Homebrew](./install-homebrew) for the easiest installation
+- **Windows**: Use [Winget](./install-winget) for Windows package management
 - **Linux**: Use the [installation script](./install-script-linux) to directly control the host machine's Nginx
 - **Linux**: Use the [installation script](./install-script-linux) to directly control the host machine's Nginx
 - **Docker**: [Install via Docker](#install-with-docker) with our bundled image that includes Nginx
 - **Docker**: [Install via Docker](#install-with-docker) with our bundled image that includes Nginx
 - **Advanced**: Download from [latest release](https://github.com/0xJacky/nginx-ui/releases/latest) and [run executable directly](#run-executable-directly), or [manually build it](./build)
 - **Advanced**: Download from [latest release](https://github.com/0xJacky/nginx-ui/releases/latest) and [run executable directly](#run-executable-directly), or [manually build it](./build)

+ 311 - 0
docs/guide/install-winget.md

@@ -0,0 +1,311 @@
+# Install with Winget
+
+This installation method is designed for Windows users who have the Windows Package Manager (winget) available.
+
+## Prerequisites
+
+- **Windows**: Windows 10 version 1709 (build 16299) or later
+- [Windows Package Manager (winget)](https://learn.microsoft.com/en-us/windows/package-manager/winget/) installed
+
+If you don't have winget installed, you can install it from the [Microsoft Store](https://www.microsoft.com/store/productId/9NBLGGH4NNS1) or download it from the [GitHub releases page](https://github.com/microsoft/winget-cli/releases).
+
+## Installation
+
+### Install Nginx UI
+
+```powershell
+winget install 0xJacky.nginx-ui
+```
+
+This command will:
+- Download and install the latest stable version of Nginx UI to `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\`
+- Set up the necessary dependencies
+- Add nginx-ui to your system PATH
+
+**Note**: The installation process does not create any configuration files. You will need to create the configuration manually or let Nginx UI create it on first run.
+
+### Verify Installation
+
+After installation, you can verify that Nginx UI is installed correctly:
+
+```powershell
+nginx-ui --version
+```
+
+### Installation Directory
+
+WinGet installs Nginx UI to the user's local directory:
+- **Installation Path**: `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\`
+- **Executable Path**: `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe`
+
+You can access this directory using:
+```powershell
+cd "%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\"
+```
+
+## Service Management
+
+On Windows, Nginx UI can be run as a Windows Service or manually started from the command line.
+
+### Install as Windows Service
+
+Since Nginx UI doesn't have built-in Windows service management, you need to manually register it using `sc.exe`:
+
+```powershell
+# Create the service (run as Administrator)
+# Note: WinGet installs to user's local directory
+sc create nginx-ui binPath= "%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe serve" start= auto
+
+# Start the service
+sc start nginx-ui
+```
+
+### Manual Service Management
+
+You can manage the service using Windows Service Manager or PowerShell:
+
+```powershell
+# Start the service
+Start-Service nginx-ui
+
+# Stop the service
+Stop-Service nginx-ui
+
+# Restart the service
+Restart-Service nginx-ui
+
+# Check service status
+Get-Service nginx-ui
+```
+
+### Set Service to Start Automatically
+
+The service is already configured to start automatically with `start= auto` in the creation command above. To change this later:
+
+```powershell
+Set-Service -Name nginx-ui -StartupType Automatic
+```
+
+## Running Manually
+
+If you prefer to run Nginx UI manually instead of as a service:
+
+```powershell
+# Run in foreground
+nginx-ui
+
+# Run with custom config
+nginx-ui serve -config C:\path\to\your\app.ini
+
+# Run directly from installation directory
+"%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe" serve
+
+# Run in background (using Start-Job)
+Start-Job -ScriptBlock { nginx-ui serve }
+```
+
+## Configuration
+
+The configuration file needs to be created manually or will be created on first run. It should be located at:
+
+- **Default Path**: `%LOCALAPPDATA%\nginx-ui\app.ini`
+- **Alternative Path**: `C:\ProgramData\nginx-ui\app.ini`
+
+Data is typically stored in:
+- `%LOCALAPPDATA%\nginx-ui\`
+- `C:\ProgramData\nginx-ui\`
+
+### Creating Configuration
+
+You can either:
+1. **Let Nginx UI create it automatically** - Run nginx-ui for the first time and it will create a default configuration in the current working directory
+2. **Create manually** - Create the directories and configuration file yourself
+
+To create the configuration directory and file manually:
+```powershell
+# Create the configuration directory
+New-Item -ItemType Directory -Force -Path "$env:LOCALAPPDATA\nginx-ui"
+
+# Create a basic configuration file
+@"
+[app]
+PageSize = 10
+
+[server]
+Host = 0.0.0.0
+Port = 9000
+RunMode = release
+
+[cert]
+HTTPChallengePort = 9180
+
+[terminal]
+StartCmd = cmd
+"@ | Out-File -FilePath "$env:LOCALAPPDATA\nginx-ui\app.ini" -Encoding utf8
+```
+
+The default configuration includes:
+```ini
+[app]
+PageSize = 10
+
+[server]
+Host = 0.0.0.0
+Port = 9000
+RunMode = release
+
+[cert]
+HTTPChallengePort = 9180
+
+[terminal]
+StartCmd = cmd
+```
+
+## Updating
+
+### Update Nginx UI
+
+```powershell
+winget upgrade nginx-ui
+```
+
+### Update all packages
+
+```powershell
+winget upgrade --all
+```
+
+## Uninstallation
+
+### Stop and Uninstall Service
+
+```powershell
+# Stop the service first
+sc stop nginx-ui
+
+# Delete the service
+sc delete nginx-ui
+
+# Uninstall the package
+winget uninstall nginx-ui
+```
+
+### Remove Configuration and Data
+
+::: warning
+
+This will permanently delete all your configurations, sites, certificates, and data. Make sure to backup any important data before proceeding.
+
+:::
+
+```powershell
+# Remove configuration and data directories
+Remove-Item -Recurse -Force "$env:LOCALAPPDATA\nginx-ui"
+Remove-Item -Recurse -Force "$env:PROGRAMDATA\nginx-ui"
+```
+
+## Troubleshooting
+
+### Port Conflicts
+
+If you encounter port conflicts (default port is 9000), you need to modify the configuration file:
+
+1. **Edit the configuration file:**
+   ```powershell
+   notepad "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   ```
+
+2. **Change the port in the `[server]` section:**
+   ```ini
+   [server]
+   Host = 0.0.0.0
+   Port = 9001
+   RunMode = release
+   ```
+
+3. **Restart the service:**
+   ```powershell
+   Restart-Service nginx-ui
+   ```
+
+### Windows Firewall
+
+If you have issues accessing Nginx UI from other devices, you may need to configure Windows Firewall:
+
+```powershell
+# Allow Nginx UI through Windows Firewall (TCP and UDP)
+New-NetFirewallRule -DisplayName "Nginx UI TCP" -Direction Inbound -Protocol TCP -LocalPort 9000 -Action Allow
+New-NetFirewallRule -DisplayName "Nginx UI UDP" -Direction Inbound -Protocol UDP -LocalPort 9000 -Action Allow
+```
+
+### Viewing Service Logs
+
+To troubleshoot service issues, you can view logs:
+
+#### Windows Event Viewer
+
+1. Open Event Viewer (`eventvwr.msc`)
+2. Navigate to Windows Logs > Application
+3. Look for events from "nginx-ui" source
+
+#### Service Logs
+
+If Nginx UI is configured to write logs to files:
+
+```powershell
+# View log files (if configured)
+Get-Content "$env:LOCALAPPDATA\nginx-ui\logs\nginx-ui.log" -Tail 50
+```
+
+### Permission Issues
+
+If you encounter permission issues:
+
+1. **Run as Administrator:** Some operations may require administrator privileges
+2. **Check folder permissions:** Ensure Nginx UI has read/write access to its configuration and data directories
+3. **Antivirus software:** Some antivirus programs may interfere with Nginx UI operation
+
+### Service Won't Start
+
+If the service fails to start:
+
+1. **Check service status:**
+   ```powershell
+   Get-Service nginx-ui
+   ```
+
+2. **Verify configuration file exists (create if needed):**
+   ```powershell
+   Test-Path "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   # If it returns False, create the configuration directory and file first
+   ```
+
+3. **Try running manually to see error messages:**
+   ```powershell
+   nginx-ui serve -config "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   # Or run directly from installation directory:
+   & "$env:LOCALAPPDATA\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe" serve -config "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   ```
+
+4. **Check for port conflicts:**
+   ```powershell
+   # Check if port 9000 is already in use
+   netstat -an | findstr :9000
+   ```
+
+## Getting Help
+
+If you encounter any issues:
+
+1. Check the [official documentation](https://nginxui.com)
+2. Search for existing issues on [GitHub](https://github.com/0xJacky/nginx-ui/issues)
+3. Create a new issue if your problem isn't already reported
+
+## Next Steps
+
+After installation, you can:
+
+1. Access the web interface at `http://localhost:9000`
+2. Complete the initial setup wizard
+3. Start configuring your Nginx sites
+4. Explore the [configuration guides](./config-server) for advanced setups

+ 1 - 0
docs/zh_CN/guide/getting-started.md

@@ -30,6 +30,7 @@ http {
 我们提供多种安装方式以满足不同需求:
 我们提供多种安装方式以满足不同需求:
 
 
 - **macOS/Linux**: 使用 [Homebrew](./install-homebrew) 最简单的安装方式
 - **macOS/Linux**: 使用 [Homebrew](./install-homebrew) 最简单的安装方式
+- **Windows**: 使用 [Winget](./install-winget) Windows 包管理器安装
 - **Linux**: 使用 [安装脚本](./install-script-linux) 直接控制主机上的 Nginx
 - **Linux**: 使用 [安装脚本](./install-script-linux) 直接控制主机上的 Nginx
 - **Docker**: 通过 [Docker 安装](#使用-docker) 使用我们提供的包含 Nginx 的镜像
 - **Docker**: 通过 [Docker 安装](#使用-docker) 使用我们提供的包含 Nginx 的镜像
 - **高级用户**: 从 [最新发行版](https://github.com/0xJacky/nginx-ui/releases/latest) 下载并 [通过执行文件运行](#通过执行文件运行),或者 [手动构建](./build)
 - **高级用户**: 从 [最新发行版](https://github.com/0xJacky/nginx-ui/releases/latest) 下载并 [通过执行文件运行](#通过执行文件运行),或者 [手动构建](./build)

+ 311 - 0
docs/zh_CN/guide/install-winget.md

@@ -0,0 +1,311 @@
+# 使用 Winget 安装
+
+此安装方法适用于已安装 Windows 包管理器 (winget) 的 Windows 用户。
+
+## 前提条件
+
+- **Windows**: Windows 10 版本 1709 (内部版本 16299) 或更高版本
+- 已安装 [Windows 包管理器 (winget)](https://learn.microsoft.com/zh-cn/windows/package-manager/winget/)
+
+如果您尚未安装 winget,可以从 [Microsoft Store](https://www.microsoft.com/store/productId/9NBLGGH4NNS1) 安装或从 [GitHub 发布页面](https://github.com/microsoft/winget-cli/releases) 下载。
+
+## 安装
+
+### 安装 Nginx UI
+
+```powershell
+winget install 0xJacky.nginx-ui
+```
+
+此命令将:
+- 下载并安装最新稳定版本的 Nginx UI 到 `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\`
+- 设置必要的依赖项
+- 将 nginx-ui 添加到系统 PATH
+
+**注意**:安装过程不会创建任何配置文件。您需要手动创建配置文件,或让 Nginx UI 在首次运行时创建。
+
+### 验证安装
+
+安装完成后,您可以验证 Nginx UI 是否正确安装:
+
+```powershell
+nginx-ui --version
+```
+
+### 安装目录
+
+WinGet 将 Nginx UI 安装到用户本地目录:
+- **安装路径**: `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\`
+- **可执行文件路径**: `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe`
+
+您可以使用以下命令访问此目录:
+```powershell
+cd "%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\"
+```
+
+## 服务管理
+
+在 Windows 上,Nginx UI 可以作为 Windows 服务运行,也可以从命令行手动启动。
+
+### 安装为 Windows 服务
+
+由于 Nginx UI 没有内置的 Windows 服务管理功能,您需要使用 `sc.exe` 手动注册:
+
+```powershell
+# 创建服务(以管理员身份运行)
+# 注意:WinGet 安装到用户本地目录
+sc create nginx-ui binPath= "%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe serve" start= auto
+
+# 启动服务
+sc start nginx-ui
+```
+
+### 手动服务管理
+
+您可以使用 Windows 服务管理器或 PowerShell 管理服务:
+
+```powershell
+# 启动服务
+Start-Service nginx-ui
+
+# 停止服务
+Stop-Service nginx-ui
+
+# 重启服务
+Restart-Service nginx-ui
+
+# 检查服务状态
+Get-Service nginx-ui
+```
+
+### 设置服务自动启动
+
+在上面的创建命令中已经通过 `start= auto` 配置了服务自动启动。如需后续修改:
+
+```powershell
+Set-Service -Name nginx-ui -StartupType Automatic
+```
+
+## 手动运行
+
+如果您更喜欢手动运行 Nginx UI 而不是作为服务:
+
+```powershell
+# 在前台运行
+nginx-ui
+
+# 使用自定义配置运行
+nginx-ui serve -config C:\path\to\your\app.ini
+
+# 直接从安装目录运行
+"%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe" serve
+
+# 在后台运行(使用 Start-Job)
+Start-Job -ScriptBlock { nginx-ui serve }
+```
+
+## 配置
+
+配置文件需要手动创建或将在首次运行时创建,应位于:
+
+- **默认路径**: `%LOCALAPPDATA%\nginx-ui\app.ini`
+- **备选路径**: `C:\ProgramData\nginx-ui\app.ini`
+
+数据通常存储在:
+- `%LOCALAPPDATA%\nginx-ui\`
+- `C:\ProgramData\nginx-ui\`
+
+### 创建配置
+
+您可以选择:
+1. **让 Nginx UI 自动创建** - 首次运行 nginx-ui,它会在当前工作目录创建默认配置
+2. **手动创建** - 自己创建目录和配置文件
+
+手动创建配置目录和文件:
+```powershell
+# 创建配置目录
+New-Item -ItemType Directory -Force -Path "$env:LOCALAPPDATA\nginx-ui"
+
+# 创建基本配置文件
+@"
+[app]
+PageSize = 10
+
+[server]
+Host = 0.0.0.0
+Port = 9000
+RunMode = release
+
+[cert]
+HTTPChallengePort = 9180
+
+[terminal]
+StartCmd = cmd
+"@ | Out-File -FilePath "$env:LOCALAPPDATA\nginx-ui\app.ini" -Encoding utf8
+```
+
+默认配置包含:
+```ini
+[app]
+PageSize = 10
+
+[server]
+Host = 0.0.0.0
+Port = 9000
+RunMode = release
+
+[cert]
+HTTPChallengePort = 9180
+
+[terminal]
+StartCmd = cmd
+```
+
+## 更新
+
+### 更新 Nginx UI
+
+```powershell
+winget upgrade nginx-ui
+```
+
+### 更新所有软件包
+
+```powershell
+winget upgrade --all
+```
+
+## 卸载
+
+### 停止并卸载服务
+
+```powershell
+# 首先停止服务
+sc stop nginx-ui
+
+# 删除服务
+sc delete nginx-ui
+
+# 卸载软件包
+winget uninstall nginx-ui
+```
+
+### 删除配置和数据
+
+::: warning 警告
+
+这将永久删除您的所有配置、站点、证书和数据。请确保在继续之前备份任何重要数据。
+
+:::
+
+```powershell
+# 删除配置和数据目录
+Remove-Item -Recurse -Force "$env:LOCALAPPDATA\nginx-ui"
+Remove-Item -Recurse -Force "$env:PROGRAMDATA\nginx-ui"
+```
+
+## 故障排除
+
+### 端口冲突
+
+如果遇到端口冲突(默认端口为 9000),您需要修改配置文件:
+
+1. **编辑配置文件:**
+   ```powershell
+   notepad "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   ```
+
+2. **在 `[server]` 部分更改端口:**
+   ```ini
+   [server]
+   Host = 0.0.0.0
+   Port = 9001
+   RunMode = release
+   ```
+
+3. **重启服务:**
+   ```powershell
+   Restart-Service nginx-ui
+   ```
+
+### Windows 防火墙
+
+如果您在从其他设备访问 Nginx UI 时遇到问题,可能需要配置 Windows 防火墙:
+
+```powershell
+# 允许 Nginx UI 通过 Windows 防火墙(TCP 和 UDP)
+New-NetFirewallRule -DisplayName "Nginx UI TCP" -Direction Inbound -Protocol TCP -LocalPort 9000 -Action Allow
+New-NetFirewallRule -DisplayName "Nginx UI UDP" -Direction Inbound -Protocol UDP -LocalPort 9000 -Action Allow
+```
+
+### 查看服务日志
+
+要排查服务问题,您可以查看日志:
+
+#### Windows 事件查看器
+
+1. 打开事件查看器 (`eventvwr.msc`)
+2. 导航到 Windows 日志 > 应用程序
+3. 查找来源为 "nginx-ui" 的事件
+
+#### 服务日志
+
+如果 Nginx UI 配置为将日志写入文件:
+
+```powershell
+# 查看日志文件(如果已配置)
+Get-Content "$env:LOCALAPPDATA\nginx-ui\logs\nginx-ui.log" -Tail 50
+```
+
+### 权限问题
+
+如果遇到权限问题:
+
+1. **以管理员身份运行:** 某些操作可能需要管理员权限
+2. **检查文件夹权限:** 确保 Nginx UI 对其配置和数据目录具有读/写访问权限
+3. **杀毒软件:** 某些杀毒程序可能会干扰 Nginx UI 的运行
+
+### 服务无法启动
+
+如果服务启动失败:
+
+1. **检查服务状态:**
+   ```powershell
+   Get-Service nginx-ui
+   ```
+
+2. **验证配置文件是否存在(如需要则创建):**
+   ```powershell
+   Test-Path "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   # 如果返回 False,请先创建配置目录和文件
+   ```
+
+3. **尝试手动运行以查看错误消息:**
+   ```powershell
+   nginx-ui serve -config "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   # 或直接从安装目录运行:
+   & "$env:LOCALAPPDATA\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe" serve -config "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   ```
+
+4. **检查端口冲突:**
+   ```powershell
+   # 检查端口 9000 是否已被占用
+   netstat -an | findstr :9000
+   ```
+
+## 获取帮助
+
+如果遇到任何问题:
+
+1. 查看 [官方文档](https://nginxui.com)
+2. 在 [GitHub](https://github.com/0xJacky/nginx-ui/issues) 上搜索现有问题
+3. 如果问题尚未报告,请创建新的问题
+
+## 下一步
+
+安装完成后,您可以:
+
+1. 在 `http://localhost:9000` 访问 Web 界面
+2. 完成初始设置向导
+3. 开始配置您的 Nginx 站点
+4. 探索 [配置指南](./config-server) 进行高级设置

+ 1 - 0
docs/zh_TW/guide/getting-started.md

@@ -30,6 +30,7 @@ http {
 我們提供多種安裝方式以滿足不同需求:
 我們提供多種安裝方式以滿足不同需求:
 
 
 - **macOS/Linux**: 使用 [Homebrew](./install-homebrew) 最簡單的安裝方式
 - **macOS/Linux**: 使用 [Homebrew](./install-homebrew) 最簡單的安裝方式
+- **Windows**: 使用 [Winget](./install-winget) Windows 套件管理員安裝
 - **Linux**: 使用 [安裝指令碼](./install-script-linux) 直接控制主機上的 Nginx
 - **Linux**: 使用 [安裝指令碼](./install-script-linux) 直接控制主機上的 Nginx
 - **Docker**: 透過 [Docker 安裝](#使用-docker) 使用我們提供的包含 Nginx 的映象
 - **Docker**: 透過 [Docker 安裝](#使用-docker) 使用我們提供的包含 Nginx 的映象
 - **高階使用者**: 從 [最新發行版](https://github.com/0xJacky/nginx-ui/releases/latest) 下載並 [透過執行檔案執行](#透過執行檔案執行),或者 [手動建構](./build)
 - **高階使用者**: 從 [最新發行版](https://github.com/0xJacky/nginx-ui/releases/latest) 下載並 [透過執行檔案執行](#透過執行檔案執行),或者 [手動建構](./build)

+ 311 - 0
docs/zh_TW/guide/install-winget.md

@@ -0,0 +1,311 @@
+# 使用 Winget 安裝
+
+此安裝方法適用於已安裝 Windows 套件管理員 (winget) 的 Windows 使用者。
+
+## 前提條件
+
+- **Windows**: Windows 10 版本 1709 (組建 16299) 或更高版本
+- 已安裝 [Windows 套件管理員 (winget)](https://learn.microsoft.com/zh-tw/windows/package-manager/winget/)
+
+如果您尚未安裝 winget,可以從 [Microsoft Store](https://www.microsoft.com/store/productId/9NBLGGH4NNS1) 安裝或從 [GitHub 發布頁面](https://github.com/microsoft/winget-cli/releases) 下載。
+
+## 安裝
+
+### 安裝 Nginx UI
+
+```powershell
+winget install 0xJacky.nginx-ui
+```
+
+此命令將:
+- 下載並安裝最新穩定版本的 Nginx UI 到 `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\`
+- 設定必要的相依性
+- 將 nginx-ui 新增到系統 PATH
+
+**注意**:安裝過程不會建立任何設定檔案。您需要手動建立設定檔案,或讓 Nginx UI 在首次執行時建立。
+
+### 驗證安裝
+
+安裝完成後,您可以驗證 Nginx UI 是否正確安裝:
+
+```powershell
+nginx-ui --version
+```
+
+### 安裝目錄
+
+WinGet 將 Nginx UI 安裝到使用者本機目錄:
+- **安裝路徑**: `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\`
+- **可執行檔路徑**: `%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe`
+
+您可以使用以下命令存取此目錄:
+```powershell
+cd "%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\"
+```
+
+## 服務管理
+
+在 Windows 上,Nginx UI 可以作為 Windows 服務執行,也可以從命令列手動啟動。
+
+### 安裝為 Windows 服務
+
+由於 Nginx UI 沒有內建的 Windows 服務管理功能,您需要使用 `sc.exe` 手動註冊:
+
+```powershell
+# 建立服務(以系統管理員身分執行)
+# 注意:WinGet 安裝到使用者本機目錄
+sc create nginx-ui binPath= "%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe serve" start= auto
+
+# 啟動服務
+sc start nginx-ui
+```
+
+### 手動服務管理
+
+您可以使用 Windows 服務管理員或 PowerShell 管理服務:
+
+```powershell
+# 啟動服務
+Start-Service nginx-ui
+
+# 停止服務
+Stop-Service nginx-ui
+
+# 重啟服務
+Restart-Service nginx-ui
+
+# 檢查服務狀態
+Get-Service nginx-ui
+```
+
+### 設定服務自動啟動
+
+在上面的建立命令中已經透過 `start= auto` 設定了服務自動啟動。如需後續修改:
+
+```powershell
+Set-Service -Name nginx-ui -StartupType Automatic
+```
+
+## 手動執行
+
+如果您更喜歡手動執行 Nginx UI 而不是作為服務:
+
+```powershell
+# 在前台執行
+nginx-ui
+
+# 使用自訂設定執行
+nginx-ui serve -config C:\path\to\your\app.ini
+
+# 直接從安裝目錄執行
+"%LOCALAPPDATA%\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe" serve
+
+# 在背景執行(使用 Start-Job)
+Start-Job -ScriptBlock { nginx-ui serve }
+```
+
+## 設定
+
+設定檔案需要手動建立或將在首次執行時建立,應位於:
+
+- **預設路徑**: `%LOCALAPPDATA%\nginx-ui\app.ini`
+- **替代路徑**: `C:\ProgramData\nginx-ui\app.ini`
+
+資料通常儲存在:
+- `%LOCALAPPDATA%\nginx-ui\`
+- `C:\ProgramData\nginx-ui\`
+
+### 建立設定
+
+您可以選擇:
+1. **讓 Nginx UI 自動建立** - 首次執行 nginx-ui,它會在當前工作目錄建立預設設定
+2. **手動建立** - 自己建立目錄和設定檔案
+
+手動建立設定目錄和檔案:
+```powershell
+# 建立設定目錄
+New-Item -ItemType Directory -Force -Path "$env:LOCALAPPDATA\nginx-ui"
+
+# 建立基本設定檔案
+@"
+[app]
+PageSize = 10
+
+[server]
+Host = 0.0.0.0
+Port = 9000
+RunMode = release
+
+[cert]
+HTTPChallengePort = 9180
+
+[terminal]
+StartCmd = cmd
+"@ | Out-File -FilePath "$env:LOCALAPPDATA\nginx-ui\app.ini" -Encoding utf8
+```
+
+預設設定包含:
+```ini
+[app]
+PageSize = 10
+
+[server]
+Host = 0.0.0.0
+Port = 9000
+RunMode = release
+
+[cert]
+HTTPChallengePort = 9180
+
+[terminal]
+StartCmd = cmd
+```
+
+## 更新
+
+### 更新 Nginx UI
+
+```powershell
+winget upgrade nginx-ui
+```
+
+### 更新所有軟體套件
+
+```powershell
+winget upgrade --all
+```
+
+## 解除安裝
+
+### 停止並解除安裝服務
+
+```powershell
+# 首先停止服務
+sc stop nginx-ui
+
+# 刪除服務
+sc delete nginx-ui
+
+# 解除安裝軟體套件
+winget uninstall nginx-ui
+```
+
+### 刪除設定和資料
+
+::: warning 警告
+
+這將永久刪除您的所有設定、站點、憑證和資料。請確保在繼續之前備份任何重要資料。
+
+:::
+
+```powershell
+# 刪除設定和資料目錄
+Remove-Item -Recurse -Force "$env:LOCALAPPDATA\nginx-ui"
+Remove-Item -Recurse -Force "$env:PROGRAMDATA\nginx-ui"
+```
+
+## 故障排除
+
+### 連接埠衝突
+
+如果遇到連接埠衝突(預設連接埠為 9000),您需要修改設定檔案:
+
+1. **編輯設定檔案:**
+   ```powershell
+   notepad "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   ```
+
+2. **在 `[server]` 部分更改連接埠:**
+   ```ini
+   [server]
+   Host = 0.0.0.0
+   Port = 9001
+   RunMode = release
+   ```
+
+3. **重啟服務:**
+   ```powershell
+   Restart-Service nginx-ui
+   ```
+
+### Windows 防火牆
+
+如果您在從其他裝置存取 Nginx UI 時遇到問題,可能需要設定 Windows 防火牆:
+
+```powershell
+# 允許 Nginx UI 通過 Windows 防火牆(TCP 和 UDP)
+New-NetFirewallRule -DisplayName "Nginx UI TCP" -Direction Inbound -Protocol TCP -LocalPort 9000 -Action Allow
+New-NetFirewallRule -DisplayName "Nginx UI UDP" -Direction Inbound -Protocol UDP -LocalPort 9000 -Action Allow
+```
+
+### 檢視服務日誌
+
+要排查服務問題,您可以檢視日誌:
+
+#### Windows 事件檢視器
+
+1. 開啟事件檢視器 (`eventvwr.msc`)
+2. 導航到 Windows 日誌 > 應用程式
+3. 查詢來源為 "nginx-ui" 的事件
+
+#### 服務日誌
+
+如果 Nginx UI 設定為將日誌寫入檔案:
+
+```powershell
+# 檢視日誌檔案(如果已設定)
+Get-Content "$env:LOCALAPPDATA\nginx-ui\logs\nginx-ui.log" -Tail 50
+```
+
+### 權限問題
+
+如果遇到權限問題:
+
+1. **以系統管理員身分執行:** 某些操作可能需要系統管理員權限
+2. **檢查資料夾權限:** 確保 Nginx UI 對其設定和資料目錄具有讀/寫存取權限
+3. **防毒軟體:** 某些防毒程式可能會干擾 Nginx UI 的執行
+
+### 服務無法啟動
+
+如果服務啟動失敗:
+
+1. **檢查服務狀態:**
+   ```powershell
+   Get-Service nginx-ui
+   ```
+
+2. **驗證設定檔案是否存在(如需要則建立):**
+   ```powershell
+   Test-Path "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   # 如果返回 False,請先建立設定目錄和檔案
+   ```
+
+3. **嘗試手動執行以檢視錯誤訊息:**
+   ```powershell
+   nginx-ui serve -config "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   # 或直接從安裝目錄執行:
+   & "$env:LOCALAPPDATA\Microsoft\WinGet\Packages\0xJacky.nginx-ui__DefaultSource\nginx-ui.exe" serve -config "$env:LOCALAPPDATA\nginx-ui\app.ini"
+   ```
+
+4. **檢查連接埠衝突:**
+   ```powershell
+   # 檢查連接埠 9000 是否已被佔用
+   netstat -an | findstr :9000
+   ```
+
+## 取得協助
+
+如果遇到任何問題:
+
+1. 查看 [官方文件](https://nginxui.com)
+2. 在 [GitHub](https://github.com/0xJacky/nginx-ui/issues) 上搜尋現有問題
+3. 如果問題尚未回報,請建立新的問題
+
+## 下一步
+
+安裝完成後,您可以:
+
+1. 在 `http://localhost:9000` 存取 Web 介面
+2. 完成初始設定精靈
+3. 開始設定您的 Nginx 站點
+4. 探索 [設定指南](./config-server) 進行進階設定