【发布时间】:2018-08-21 02:40:58
【问题描述】:
是否有文档显示如何在 Google App Engine - 灵活的 PHP 上强制使用 HTTPS?
我尝试将 secure 放在 app.yaml 上,但没有运气。
我也尝试在 nginx-app.conf 中放置这个,但没有运气。
我也试过了
set $test "";
if ($http_x_forwarded_proto = 'http') {
set $test "http";
}
if ($test = 'http-non-cron') {
return 301 https://$host$request_uri;
}
我尝试过的其他选项
<?php
header("Strict-Transport-Security: max-age=31536000; includeSubDomains; preload");
exit();
?>
但没有运气。
【问题讨论】:
-
@DanCornilescu,您能否展示 X-Forwarded-Proto 的示例?我查看了来自owasp.org/index.php/HTTP_Strict_Transport_Security_Cheat_Sheet 的链接,但我想要一个 PHP 示例
-
我自己没用过,只记得看到了答案,指向官方文档的指针。
-
也不是 PHP 用户,但我看到 stackoverflow.com/questions/768431/…
-
@DanCornilescu 你能在回答中传达你的信息吗?社区将受益于将答案作为 answer 以及您 :) 或者,如果您认为该问题是重复的,请将其标记。谢谢你和mulțumesc。
标签: php google-app-engine