[GH-ISSUE #1009] 快速上手失败 #536

Closed
opened 2026-02-26 12:08:39 +03:00 by kerem · 8 comments
Owner

Originally created by @kischn on GitHub (May 7, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1009

Hi,尊敬的开发者们,我先后通过 docker-compose 和 windows exe 两种方式快速上手,均失败,还请帮忙分析一下是哪里操作不对。

docker 方式

services:
    nginx-ui:
        stdin_open: true
        tty: true
        container_name: nginx-ui
        restart: always
        environment:
            - TZ=Asia/Shanghai
        volumes:
            - 'nginx_conf:/etc/nginx'
            - 'nginx_ui:/etc/nginx-ui'
            - 'www_data:/var/www'
        ports:
            - 8080:80
            - 8443:443
        image: 'uozi/nginx-ui:latest'
volumes:
  nginx_conf:
  nginx_ui:
  www_data:

使用上述指令启动后,8080 和 8443 均没有任何响应, curl 显示 empty response,进入容器后 curl 80 和 443 也没有任何响应,同时,tty 中无任何日志打印,隧放弃此方式,尝试使用更简单的方式试用一下。

windows 绿色应用

在 github release 页面下载 v2.0.0-rc.6 中的 nginx-ui-windows-64.tar.gz,SHA256: 624b020b3d7151e90d6c9ff5714d94814024f4c430ad44c4887284b1abf470d3
解压后在旁边创建 app.ini,内容如下:

[server]
Host    = 0.0.0.0
Port    = 9999
HttpPort = 9999
RunMode = debug

使用命令 .\nginx-ui.exe --config .\app.ini 启动失败,说是 9000 端口被占用,但是我明明已经通过配置文件指定了其他端口。
并且关于端口的配置,我看官方文档里面是 echo '[server]\nHttpPort = 9000' > app.ini 这样的操作,但是代码示例里面是 Port ,我干脆两个都配置上,仍然无法将应用配置为监听 9999 端口。

Image

还请各位开发者,有时间帮忙解答一下,感谢

Originally created by @kischn on GitHub (May 7, 2025). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1009 Hi,尊敬的开发者们,我先后通过 docker-compose 和 windows exe 两种方式快速上手,均失败,还请帮忙分析一下是哪里操作不对。 ## docker 方式 ```yaml services: nginx-ui: stdin_open: true tty: true container_name: nginx-ui restart: always environment: - TZ=Asia/Shanghai volumes: - 'nginx_conf:/etc/nginx' - 'nginx_ui:/etc/nginx-ui' - 'www_data:/var/www' ports: - 8080:80 - 8443:443 image: 'uozi/nginx-ui:latest' volumes: nginx_conf: nginx_ui: www_data: ``` 使用上述指令启动后,8080 和 8443 均没有任何响应, curl 显示 empty response,进入容器后 curl 80 和 443 也没有任何响应,同时,tty 中无任何日志打印,隧放弃此方式,尝试使用更简单的方式试用一下。 ## windows 绿色应用 在 github release 页面下载 v2.0.0-rc.6 中的 `nginx-ui-windows-64.tar.gz`,SHA256: 624b020b3d7151e90d6c9ff5714d94814024f4c430ad44c4887284b1abf470d3 解压后在旁边创建 `app.ini`,内容如下: ```ini [server] Host = 0.0.0.0 Port = 9999 HttpPort = 9999 RunMode = debug ``` 使用命令 `.\nginx-ui.exe --config .\app.ini` 启动失败,说是 9000 端口被占用,但是我明明已经通过配置文件指定了其他端口。 并且关于端口的配置,我看官方文档里面是 `echo '[server]\nHttpPort = 9000' > app.ini` 这样的操作,但是代码示例里面是 Port ,我干脆两个都配置上,仍然无法将应用配置为监听 `9999` 端口。 <img width="1345" alt="Image" src="https://github.com/user-attachments/assets/4d1c8eea-e191-4be6-8b60-f81a3f19efce" /> 还请各位开发者,有时间帮忙解答一下,感谢
kerem 2026-02-26 12:08:39 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kischn commented on GitHub (May 7, 2025):

我试了一下发现官方文档中的 docker 示例没有把 nginx-ui 的 9000 端口暴露出来,手动暴露一下端口就可以访问nginx-ui 了。

Image

但是手动指定端口这个还请各开发者看一下配置为何没有生效呢?

<!-- gh-comment-id:2856893186 --> @kischn commented on GitHub (May 7, 2025): 我试了一下发现官方文档中的 docker 示例没有把 nginx-ui 的 9000 端口暴露出来,手动暴露一下端口就可以访问nginx-ui 了。 <img width="605" alt="Image" src="https://github.com/user-attachments/assets/0fb0fec9-1ba5-46c1-a991-d4d0ed038ee5" /> 但是手动指定端口这个还请各开发者看一下配置为何没有生效呢?
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

echo '[server]\nHttpPort = 9000' > app.ini

这个是文档没更新,我稍后会更新文档。

你试试直接双击运行 nginx.exe 呢?

<!-- gh-comment-id:2856895816 --> @0xJacky commented on GitHub (May 7, 2025): ``` echo '[server]\nHttpPort = 9000' > app.ini ``` 这个是文档没更新,我稍后会更新文档。 你试试直接双击运行 nginx.exe 呢?
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

或者试试 执行 nginx.exe 的时候传入绝对路径的配置文件地址。

<!-- gh-comment-id:2856898027 --> @0xJacky commented on GitHub (May 7, 2025): 或者试试 执行 nginx.exe 的时候传入绝对路径的配置文件地址。
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

一般来说 docker-compose 里的 nginx 正常启动了,就不需要暴露 9000 端口。我做了反向代理访问 80 端口可以直接访问 Nginx UI

<!-- gh-comment-id:2856898973 --> @0xJacky commented on GitHub (May 7, 2025): 一般来说 docker-compose 里的 nginx 正常启动了,就不需要暴露 9000 端口。我做了反向代理访问 80 端口可以直接访问 Nginx UI
Author
Owner

@kischn commented on GitHub (May 7, 2025):

或者试试 执行 nginx.exe 的时候传入绝对路径的配置文件地址。

通过指定绝对路径这样的方式可以了,感谢。

<!-- gh-comment-id:2856899697 --> @kischn commented on GitHub (May 7, 2025): > 或者试试 执行 nginx.exe 的时候传入绝对路径的配置文件地址。 通过指定绝对路径这样的方式可以了,感谢。
Author
Owner

@kischn commented on GitHub (May 7, 2025):

一般来说 docker-compose 里的 nginx 正常启动了,就不需要暴露 9000 端口。我做了反向代理访问 80 端口可以直接访问 Nginx UI

Image

目前我在容器内看了一下 nginx 的几个配置目录都是空的,不过我现在的问题解决了,我可以继续上手试用了,感谢

<!-- gh-comment-id:2856903899 --> @kischn commented on GitHub (May 7, 2025): > 一般来说 docker-compose 里的 nginx 正常启动了,就不需要暴露 9000 端口。我做了反向代理访问 80 端口可以直接访问 Nginx UI <img width="744" alt="Image" src="https://github.com/user-attachments/assets/8694cf4e-155e-4a68-8773-e58074c37d48" /> 目前我在容器内看了一下 nginx 的几个配置目录都是空的,不过我现在的问题解决了,我可以继续上手试用了,感谢
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

好的

<!-- gh-comment-id:2856911435 --> @0xJacky commented on GitHub (May 7, 2025): 好的
Author
Owner

@kischn commented on GitHub (May 7, 2025):

我的问题解决了,感谢。

不过以我的保守观念来说,要将 nginx-ui 部署到生产时我会更倾向于使用独立的端口来操作 nginx-ui,然后通过安全组或系统防火墙策略指定IP白名单来进行访问限制,公开的80/443 端口只提供网站服务,希望贵项目能够在设计时支持通过环境变量来指定是否自动将 nginx-ui 加入到 conf.d 中,再次感谢!

PS: 当然 nginx 的 deny 指令也支持通过 ip 进行限制,通过环境变化来指定这个也不是不可以。

一般来说 docker-compose 里的 nginx 正常启动了,就不需要暴露 9000 端口。我做了反向代理访问 80 端口可以直接访问 Nginx UI

<!-- gh-comment-id:2856919484 --> @kischn commented on GitHub (May 7, 2025): 我的问题解决了,感谢。 不过以我的保守观念来说,要将 nginx-ui 部署到生产时我会更倾向于使用独立的端口来操作 nginx-ui,然后通过安全组或系统防火墙策略指定IP白名单来进行访问限制,公开的80/443 端口只提供网站服务,希望贵项目能够在设计时支持通过环境变量来指定是否自动将 nginx-ui 加入到 conf.d 中,再次感谢! PS: 当然 nginx 的 deny 指令也支持通过 ip 进行限制,通过环境变化来指定这个也不是不可以。 > 一般来说 docker-compose 里的 nginx 正常启动了,就不需要暴露 9000 端口。我做了反向代理访问 80 端口可以直接访问 Nginx UI
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#536
No description provided.