Symfony2:如何强制整个应用程序的HTTPS?

前端之家收集整理的这篇文章主要介绍了Symfony2:如何强制整个应用程序的HTTPS?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

是否可以强制https用于整个应用程序,而无需为所有100个路由/防火墙规则定义它?

我们试图在网络服务器级别强制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
原文链接:https://www.f2er.com/nginx/434777.html

猜你在找的Nginx相关文章