Skip to content

Conversation

@wcbing
Copy link
Contributor

@wcbing wcbing commented Jul 5, 2024

使用 $server_name 在使用通配符域名等情况下无法跳转,建议使用 $host。
强制HTTPS我觉得应该是永久重定向比较好吧。

@wcbing
Copy link
Contributor Author

wcbing commented Jul 5, 2024

我看上一个修改是因为这个 issue,这个里面(Certbot)也都是 $host 和 301。

@0xJacky
Copy link
Owner

0xJacky commented Jul 6, 2024

首先感谢您的 PR,用 $host 跳转的话是 ok。但我用 307 是因为 301 重定向的时候会丢失 POST 的 body。

@wcbing
Copy link
Contributor Author

wcbing commented Jul 6, 2024

首先感谢您的 PR,用 $host 跳转的话是 ok。但我用 307 是因为 301 重定向的时候会丢失 POST 的 body。

那不是也有 308 吗。
不过主流浏览器对于301一般是按照HTTP标准来实现的,不存在“丢失 POST 的 body”这个问题。也就是301和308没什么区别。

@0xJacky
Copy link
Owner

0xJacky commented Jul 6, 2024

可以,麻烦您修改一下,我合并

@0xJacky
Copy link
Owner

0xJacky commented Jul 6, 2024

@wcbing
Copy link
Contributor Author

wcbing commented Jul 6, 2024

我知道,所以我强调了“主流浏览器”。
反正我看到的用法都是301,你想改那我就改吧😂

@0xJacky 0xJacky changed the title fix: http-to-https use $host and 301 fix: http-to-https use $host and 308 Jul 6, 2024
@0xJacky 0xJacky merged commit 7fb8459 into 0xJacky:dev Jul 6, 2024
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 this pull request may close these issues.

2 participants