Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails with Spring安全插件在Amazon Elastic Beanstalk上使用REQUIRES_SECURE_通道时不从http重定向到https_Grails_Https_Amazon Web Services_Spring Security_Amazon Elastic Beanstalk - Fatal编程技术网

Grails with Spring安全插件在Amazon Elastic Beanstalk上使用REQUIRES_SECURE_通道时不从http重定向到https

Grails with Spring安全插件在Amazon Elastic Beanstalk上使用REQUIRES_SECURE_通道时不从http重定向到https,grails,https,amazon-web-services,spring-security,amazon-elastic-beanstalk,Grails,Https,Amazon Web Services,Spring Security,Amazon Elastic Beanstalk,我正在使用Grails2.1和Spring安全插件。我有一些路径需要设置\u安全\u通道。当我使用“grails run app-https”在我的机器上运行我的应用程序时,当从http访问需要https的路径时,一切都正常工作,它们会被重定向。但是,在Amazon弹性Beanstalk上,需要https的路径不会从http重定向到https 我已经准备好了 grails.plugins.springsecurity.secureChannel.useHeaderCheckChannelSecu

我正在使用Grails2.1和Spring安全插件。我有一些路径需要设置\u安全\u通道。当我使用“grails run app-https”在我的机器上运行我的应用程序时,当从http访问需要https的路径时,一切都正常工作,它们会被重定向。但是,在Amazon弹性Beanstalk上,需要https的路径不会从http重定向到https

我已经准备好了

grails.plugins.springsecurity.secureChannel.useHeaderCheckChannelSecurity = true 
在Config.groovy中用于生产和

grails.plugins.springsecurity.secureChannel.useHeaderCheckChannelSecurity = false
在Config.groovy中进行开发

如果我将telnet连接到端口80并请求一个需要设置_SECURE_通道的路径,这就是我在Amazon Elastic Beanstalk上看到的:

$ telnet www.example.com 80
Connected to www.example.com.
Escape character is '^]'.
GET /login/index HTTP/1.1
Host: www.example.com

HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Location: http://www.example.com/login/index
Content-Length: 0
Date: Wed, 10 Oct 2012 19:40:29 GMT
如果我使用开发环境远程登录到端口8080,并请求设置了REQUIRES_SECURE_CHANNEL的路径,这就是我在机器上看到的:

$ telnet localhost 8080
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /server/login/index HTTP/1.1
Host: localhost:8080

HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Location: https://localhost:8443/server/login/index
Content-Length: 0
Date: Wed, 10 Oct 2012 19:27:09 GMT

如何让我在Amazon Elastic Beanstalk上的应用程序正确地将需要设置“安全”通道的路径从http转发到https?

似乎在讨论同样的问题。然而,它并没有说这个人是否正在使用弹性豆茎。我想知道这是否提供了一个线索?谢谢@andrew!看起来我需要一个定制的AMI来解决这个问题。我将尽快尝试您在亚马逊AWS论坛上提出的解决方案。您对grails.plugins.springsecurity.secureChannel.secureHeaderName的价值是什么?难道不是x-forwarded-proto吗?@andrew我将我的AMI更新为AMI-1624987f,当时使用的是AMI-aecd60c7。它在/etc/httpd/conf.d/elasticbeanstalk.conf中有ProxyPreserveHost,在/etc/tomcat7/server.xml中有您在文章中提到的阀门