mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 16:55:56 +03:00
[GH-ISSUE #389] 二级域名的反向代理可随意访问 #1567
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#1567
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 @thansury on GitHub (May 12, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/389
二级域名aa.bb.com经过反代后,可以随意更改前缀aa为任意字符,均可访问服务器。如果在高级设置里,添加上


if ($host != $server_name) {
return 204;
}
则可以避免这个问题。
实际上反向代理模板是没有这个代码的,请求开发者下一更新添加此代码!感谢开发者带来的优秀产品,使我省了很多时间。
@0xJacky commented on GitHub (May 12, 2024):
返回 404 好像也可以?
@thansury commented on GitHub (May 12, 2024):
是的,返回204和404都可以,主要是没有上面那个host !=$server_name一行代码。这行判定使我后来加上的。原来的模板上没有。希望下一个版本的模板上能加上这一行代码
@0xJacky commented on GitHub (May 12, 2024):
我加在 server block 里应该也是可以的吧
github.com/0xJacky/nginx-ui@7ce0c1f951