gpt4 book ai didi

Symfony2 : How to force HTTPS for the whole app?

转载 作者:行者123 更新时间:2023-12-04 12:58:56 24 4
gpt4 key购买 nike

是否可以在不为所有 100 条路由/防火墙规则定义的情况下为整个应用程序强制使用 https?

我们试图在网络服务器级别强制使用 https,但 symfony2 仍然尝试重定向到 http 并生成一些奇怪的链接(http://[...]:443)。

我阅读了配置文档,但没有找到任何相关内容。所有食谱条目也仅用于根据路由/安全规则启用它。

最佳答案

How to force HTTPS or HTTP for Different URLs

The Security component provides a way to enforce HTTPs via the requires_channel setting. This alternative method is better suited to secure an "area" of your website (all URLs under /admin) or when you want to secure URLs defined in a third party bundle.


access_control:
- path: ^/secure
roles: ROLE_ADMIN
requires_channel: https

关于Symfony2 : How to force HTTPS for the whole app?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18827267/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com