mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 08:45:58 +03:00
[GH-ISSUE #1510] Stream重命名时,被同步的节点不能删除旧stream #6608
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#6608
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @FourLeafTec on GitHub (Jan 3, 2026).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1510
Stream配置[S1]由主节点向节点A同步
在主节点重命名[S1]为[S2],节点A不能同步重命名,会变成[S1],[S2]共存,这时Stream里的upstream命名就会冲突
另外我这里还有个问题不知道是不是和这个问题有关
主节点第一次向节点A同步[S1]时,节点A也会报[emerg] duplicate upstream "s1_upstream"
通过grep -r "upstream s1_upstream" /etc/nginx/ 也查不到第二个这个upstream
[S1]配置为
找到原因了,但不知道是哪一步操作引起的,nginx.conf变成了下面这样,stream和http的配置都被修改成了include两遍
@0xJacky commented on GitHub (Feb 7, 2026):
@cursoragent fix it
@cursor[bot] commented on GitHub (Feb 7, 2026):
I've fixed the issue with duplicate include directives in nginx.conf. Here's a summary of the changes:
Problem: The
FixNginxConfIncludeSites,FixNginxConfIncludeStreams, andFixNginxConfIncludeConfDfunctions ininternal/self_check/nginx_conf.gowere appending include directives without checking if they already existed. This caused duplicate includes like:Solution: Added checks in each Fix function to verify if the include directive already exists before adding a new one:
FixNginxConfIncludeSitesnow checks for existingsites-enabledincludesFixNginxConfIncludeStreamsnow checks for existingstreams-enabledincludesFixNginxConfIncludeConfDnow checks for existingconf.dincludesIf the include already exists, the functions return
nilwithout modifying the file.Testing: Added a new test
TestFixNginxConfNoDuplicateIncludesthat: