Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二级域名的反向代理可随意访问 #389

Closed
thansury opened this issue May 12, 2024 · 3 comments · Fixed by #402
Closed

二级域名的反向代理可随意访问 #389

thansury opened this issue May 12, 2024 · 3 comments · Fixed by #402

Comments

@thansury
Copy link

thansury commented May 12, 2024

二级域名aa.bb.com经过反代后,可以随意更改前缀aa为任意字符,均可访问服务器。如果在高级设置里,添加上
if ($host != $server_name) {
return 204;
}
则可以避免这个问题。
EN9UIPAXTC0R(66@`BQD$ 7
QQ截图20240512174257

实际上反向代理模板是没有这个代码的,请求开发者下一更新添加此代码!感谢开发者带来的优秀产品,使我省了很多时间。

@0xJacky
Copy link
Owner

0xJacky commented May 12, 2024

返回 404 好像也可以?

@thansury
Copy link
Author

thansury commented May 12, 2024

返回 404 好像也可以?

是的,返回204和404都可以,主要是没有上面那个host !=$server_name一行代码。这行判定使我后来加上的。原来的模板上没有。希望下一个版本的模板上能加上这一行代码

0xJacky added a commit that referenced this issue May 12, 2024
@0xJacky
Copy link
Owner

0xJacky commented May 12, 2024

我加在 server block 里应该也是可以的吧
7ce0c1f

@0xJacky 0xJacky mentioned this issue May 21, 2024
4 tasks
@0xJacky 0xJacky linked a pull request May 21, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants