[GH-ISSUE #603] 建议Casdoor的Endpoint区分内外部访问 #303

Closed
opened 2026-02-26 12:07:55 +03:00 by kerem · 1 comment
Owner

Originally created by @chung1912 on GitHub (Oct 9, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/603

目前casdoor的参数Endpoint是内外部访问共用,即点击sso登录时,浏览器跳转的地址是Endpoint,容器内部(nginx ui后台)访问casdoor服务器也是Endpoint,这导致一些部署场景出现问题,例如:
当docker-compose部署采用非桥接模式时,浏览器需要访问192.168.1.5:8000进入casdoor的登录页面,但是容器内部无法访问192.168.1.5:8000,因此会连接超时;如果Endpoint采用casdoor的hostname或者casdoor容器的ip(例如172.88.0.2),容器内部可以casdoor,但是浏览器是不能访问;
目前解决的方案,是nginx ui必须部署为桥接网络,这造成了部署的限制

建议Endpoint区分为两个环境变量,例如新增一个NGINX_UI_CASDOOR_URL环境变量,该变量为点击“sso登录”时,浏览器跳转至casdoor的网页的base_url;原来的NGINX_UI_CASDOOR_ENDPOINT只用于容器内部(nginx ui后台)访问casdoor服务器

Originally created by @chung1912 on GitHub (Oct 9, 2024). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/603 目前casdoor的参数Endpoint是内外部访问共用,即点击sso登录时,浏览器跳转的地址是Endpoint,容器内部(nginx ui后台)访问casdoor服务器也是Endpoint,这导致一些部署场景出现问题,例如: 当docker-compose部署采用非桥接模式时,浏览器需要访问192.168.1.5:8000进入casdoor的登录页面,但是容器内部无法访问192.168.1.5:8000,因此会连接超时;如果Endpoint采用casdoor的hostname或者casdoor容器的ip(例如172.88.0.2),容器内部可以casdoor,但是浏览器是不能访问; 目前解决的方案,是nginx ui必须部署为桥接网络,这造成了部署的限制 **建议Endpoint区分为两个环境变量,例如新增一个NGINX_UI_CASDOOR_URL环境变量,该变量为点击“sso登录”时,浏览器跳转至casdoor的网页的base_url;原来的NGINX_UI_CASDOOR_ENDPOINT只用于容器内部(nginx ui后台)访问casdoor服务器**
kerem 2026-02-26 12:07:55 +03:00
Author
Owner

@0xJacky commented on GitHub (Dec 15, 2024):

已在 835349c33f 中添加,将会在 v2.0.0-beta.42 中发布。

<!-- gh-comment-id:2543572593 --> @0xJacky commented on GitHub (Dec 15, 2024): 已在 835349c33f622703ecb00a9f3ed9182b386aecb2 中添加,将会在 v2.0.0-beta.42 中发布。
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#303
No description provided.