作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
是否可以在不为所有 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/
我是一名优秀的程序员,十分优秀!