Closed carolcoral closed 1 year ago
@carolcoral: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.
关于 Site URL 的配置问题,我有一个建议:
Halo 目前在 HaloProperties 中提供了 externalUrl
的配置,主要是为了避免用户在各个插件都手动配置它。这里建议直接调用 ExternalURLSupplier#getURL(HttpRequest)方法获取 Site URL。这里将优先返回用户配置的 halo.externalUrl
,其次才会解析当前用户所请求的域名。
如果无法正常获取当前用户所请求的域名,大概率是因为反向代理工具(如 Nginx)没有正确代理 X-Forward-For
头。
Hi @carolcoral ,我发现在当前版本中无法正常调用 ExternalUrlSupplier#getURL(HttpRequest) 方法,我将尝试升级一下 Halo 的依赖来支持。
已升级。
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To complete the pull request process, please assign guqing after the PR has been reviewed.
You can assign the PR to them by writing /assign @guqing
in a comment when ready.
The full list of commands accepted by this bot can be found here.
关于 Site URL 的配置问题,我有一个建议:
Halo 目前在 HaloProperties 中提供了
externalUrl
的配置,主要是为了避免用户在各个插件都手动配置它。这里建议直接调用 ExternalURLSupplier#getURL(HttpRequest)方法获取 Site URL。这里将优先返回用户配置的halo.externalUrl
,其次才会解析当前用户所请求的域名。如果无法正常获取当前用户所请求的域名,大概率是因为反向代理工具(如 Nginx)没有正确代理
X-Forward-For
头。
不仅仅是存在NG代理设置问题导致的获取站点地图和期望地址不一致问题。同时存在多重穿透和CDN源站方式导致的获取到的站点地址加上了源站地址的端口(实际上访问地址是没有端口的,仅源站存在端口)
希望一个 PR 只单纯的解决一个问题,不要在一个 PR 中做多件事,并且希望先提一个 issue 来与之关联让我们知道到底发生了什么事,不然会给 reviewer 带来困扰。
目前你的 PR 包含了之前已经合并的改动,很难 review,建议:
# https or ssh
git remote add upstream https://github.com/halo-dev/plugin-sitemap.git
git fetch upstream/main
git merge upstream/main
git reset --soft upstream/main
git add .
git commit -m '这里改为你的提交信息'
git push origin HEAD -f
希望一个 PR 只单纯的解决一个问题,不要在一个 PR 中做多件事,并且希望先提一个 issue 来与之关联让我们知道到底发生了什么事,不然会给 reviewer 带来困扰。
目前你的 PR 包含了之前已经合并的改动,很难 review,建议:
# https or ssh git remote add upstream https://github.com/halo-dev/plugin-sitemap.git git fetch upstream/main git merge upstream/main git reset --soft upstream/main git add . git commit -m '这里改为你的提交信息' git push origin HEAD -f
解决ISSUE:
因为PR最开始仅仅解决 https://github.com/halo-dev/plugin-sitemap/issues/11 但未被接受PR。因此后续的commit被依次提交了。
目前来看:
如果依然不符合您的要求,请直接关闭当前PR吧,不想折腾了
如果依然不符合您的要求,请直接关闭当前PR吧,不想折腾了
实际上 reset 之后重新 commit 并强制推送即可,不过依旧感谢你参与贡献。
针对这个问题已经有了一个新的 PR:https://github.com/halo-dev/plugin-sitemap/pull/25,欢迎 Review 和测试。
/close
@ruibaby: Closed this PR.
Change
为了解决了站点在使用反向代理、NG代理、CDN回源等情况下,domain://sitemap.xml 中的站点地址与实际期望的访问地址不一致问题
FIX