ELB背后的Symfony2正在重定向到http而不是https
2022-08-30 15:43:52
						问题:
- 用户使用 https://example.com/login 登录
 - 身份验证已批准
 - 如在安全性中配置的那样。yml Symfony2 在登录后将用户重定向到配置文件页面。
 - 但它将它们重定向到错误的网址 http://example.com/homepage
 
security.yml:
security:
    encoders:
        FOS\UserBundle\Model\UserInterface: sha512
    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
    providers:
        fos_userbundle:
            id: fos_user.user_provider.username_email
    firewalls:
        main:
            pattern:    ^/
            form_login:
                check_path: /login_check
                login_path: /login
                default_target_path: /profile
                provider: fos_userbundle
            logout:
                path:   /logout
                target: /splash
            anonymous: ~
    access_control:
        - { roles: ROLE_USER, requires_channel: https }
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
    acl:
        connection: default
环境架构:

Server1 和 Server2 拥有 Symfony2 应用程序。
问题:
如何强制Symfony使用https协议而不是http生成重定向URL?
到目前为止,我已经查看了这些文档,并且该解决方案在我的情况下不起作用: