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

ServerRequest::createUriFromGlobal() 拼接 URI 时建议优先取 HTTP_HOST,而非 SERVER_NAME #27

Closed
xsharp opened this issue Dec 4, 2018 · 0 comments

Comments

@xsharp
Copy link
Contributor

xsharp commented Dec 4, 2018

如题。
优先取 SERVER_NAME 可能有什么问题?
比如 nginx 中设置站点为:
server_name ~^(?<subdomain>.+).yourname.com$;
那么拼接的 URI 可能是这样的:
http://~^(?<subdomain>.+).yourname.com$/abc,这样的 URI 不能被正确路由。

更多关于 SERVER_NAMEHTTP_HOST 区别:
https://stackoverflow.com/questions/2297403/what-is-the-difference-between-http-host-and-server-name-in-php

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

No branches or pull requests

2 participants