首页 文章

当我使用AWS ELB Spring Boot时,如何将http重定向到https?

提问于
浏览
0

我正在设置支持AWS ELB的Spring Boot Admin .

配置是......

ELB(http,80) - >应用程序(8080)ELB(https,443) - >应用程序(8080)并且,有/ ping endpoints 用于ELB运行状况检查 .

我希望每个ELB http请求都被重定向到https .

我试过这个解决方案 .

Spring Boot with Embedded Tomcat behind AWS ELB - HTTPS redirect

但它没有用,因为这会重定向包含/ ping的所有东西,而且ELB无法进行 Health 检查 .

我能做什么?

1 回答

  • 0

    我想,你可以在httpd级别做 .

    转到您的ssl.conf文件

    您可以在/etc/httpd/conf.d path中找到在虚拟主机443中添加以下内容

    SSLProxyEngine  on
    
    ProxyPass /ping/ http://127.0.0.1:8080/ping/ Keepalive=On
    
    ProxyPassReverse /ping/ https://127.0.0.1:8080/ping/
    
    ProxyPass / https://127.0.0.1:8080/ Keepalive=On
    
    ProxyPassReverse / https://127.0.0.1:8080/
    

相关问题