尝试将所有http请求重定向到HTTPS。
我的web.conf上有重定向规则,但是我收到的重定向错误太多了。
发现我需要设置我的Elasticbeanstalk以运行“container_command”来运行脚本。我得到了这张照片。
将它放在几个山药结构检查器中,它们都通过它。
[2017-02-13T21:40:40.129Z] INFO [1090] : Loading manifest from bucket 'elasticbeanstalk-us-west-2-943111687699' using computed S3 key 'resources/environments/e-ecbvzu2fms/_runtime/versions/manifest_000000000000'.
[2017-02-13T21:40:40.273Z] INFO [1090] : Updated manifest cache: deployment ID 90 and serial 90.
[2017-02-13T21:40:40.273Z] DEBUG [1090] : Loaded definition of Command CMD-AppDeploy.
[2017-02-13T21:40:40.274Z] INFO [1090] : Executing Application update
[2017-02-13T21:40:40.274Z] INFO [1090] : Executing command: CMD-AppDeploy...
[2017-02-13T21:40:40.274Z] INFO [1090] : Executing command CMD-AppDeploy activities...
[2017-02-13T21:40:40.274Z] DEBUG [1090] : Setting environment variables..
[2017-02-13T21:40:40.274Z] INFO [1090] : Running AddonsBefore for command CMD-AppDeploy...
[2017-02-13T21:40:40.274Z] DEBUG [1090] : Running stages of Command CMD-AppDeploy from stage 0 to stage 1...
[2017-02-13T21:40:40.274Z] INFO [1090] : Running stage 0 of command CMD-AppDeploy...
[2017-02-13T21:40:40.274Z] INFO [1090] : Running leader election...
[2017-02-13T21:40:40.522Z] INFO [1090] : Instance is Leader.
[2017-02-13T21:40:40.522Z] DEBUG [1090] : Loaded 6 actions for stage 0.
[2017-02-13T21:40:40.522Z] INFO [1090] : Running 1 of 6 actions: InfraWriteConfig...
[2017-02-13T21:40:40.528Z] INFO [1090] : Running 2 of 6 actions: DownloadSourceBundle...
[2017-02-13T21:40:44.724Z] INFO [1090] : Running 3 of 6 actions: EbExtensionPreBuild...
[2017-02-13T21:40:45.102Z] INFO [1090] : Running 4 of 6 actions: AppDeployPreHook...
[2017-02-13T21:41:01.347Z] INFO [1090] : Running 5 of 6 actions: EbExtensionPostBuild...
[2017-02-13T21:41:02.390Z] INFO [1090] : Running 6 of 6 actions: InfraCleanEbextension...
[2017-02-13T21:41:02.392Z] INFO [1090] : Running stage 1 of command CMD-AppDeploy...
[2017-02-13T21:41:02.392Z] DEBUG [1090] : Loaded 2 actions for stage 1.
[2017-02-13T21:41:02.392Z] INFO [1090] : Running 1 of 2 actions: AppDeployEnactHook...
[2017-02-13T21:41:21.024Z] INFO [1090] : Running 2 of 2 actions: AppDeployPostHook...
[2017-02-13T21:41:21.613Z] INFO [1090] : Running AddonsAfter for command CMD-AppDeploy...
[2017-02-13T21:41:22.088Z] INFO [1090] : Command CMD-AppDeploy succeeded!
答案 0 :(得分:0)
无法在EBS上运行该命令,通过在UrlRewriteFilter上添加规则解决了我的问题。
不是最好的方式,但现在可以使用
<rule>
<condition type="header" operator="notequal" name="X-Forwarded-Proto">^HTTPS$</condition>
<condition name="host" operator="equal"test.com</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://www.test.com/$1</to>
</rule>
<rule>