Ich habe vor kurzem eine Webanwendung mit AWS Elastic Beanstalk erstellt und einen EC2 Classic Load Balancer eingerichtet, HTTP-URLs auf HTTPS umzuleiten. Momentan kann ich mit HTTP oder HTTPS auf meine Site zugreifen, aber ich möchte jede Anfrage automatisch an HTTPS senden. Ich entwickelte und implementierte meine ASP.NET MVC-Anwendung von Visual Studio 2015 mithilfe von AWS Toolkit (ansonsten wurde die gesamte Website-Funktionalität in AWS eingerichtet). Ich bin ganz neu bei AWS und nachdem ich eine Reihe von Beiträgen darüber gelesen habe, konnte ich keine Möglichkeit finden, eine Weiterleitung von HTTP zu HTTPS zu erzwingen. Ich schaute auf diese Seite https://oanhnn.github.io/2016-02-29/how-to-force-https-behind-aws-elb.html, war aber nicht sicher, wie das, was besprochen wurde, zu implementieren. Wenn jemand weiß, wie man das macht oder gute Dokumentation dafür kennt, würde ich es sehr schätzen.ASP.NET MVC App - AWS Load Balancer Redirect HTTP zu Https
0
A
Antwort
1
Sie werden müssen:
- URL Rewrite auf Ihrem Windows-Server installieren.
- Fügen Sie den folgenden
<rewrite>
Abschnitt in Ihrer Datei Web.config:
Web.config
<configuration>
...
<system.webServer>
...
<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
<outboundRules>
<rule name="Add Strict-Transport-Security when HTTPS" enabled="true">
<match serverVariable="RESPONSE_Strict_Transport_Security" pattern=".*" />
<conditions>
<add input="{HTTPS}" pattern="on" ignoreCase="true" />
</conditions>
<action type="Rewrite" value="max-age=31536000" />
</rule>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
Verwandte Themen
- 1. AWS EC2 Umleiten von HTTP zu HTTPS durch Load Balancer
- 2. Aws Elastic Load Balancer
- 3. AWS - SSL/https auf Load Balancer
- 4. Umleiten von http zu https mithilfe von Application Load Balancer
- 5. GCE Load Balancer HTTPS und HTTP IP
- 6. AWS Load Balancer
- 7. Http Binding Load Balancer
- 8. Anwendung Load Balancer + Nginx http zu https Redirect gibt 502 Bad Gateway
- 9. Routing Verkehr von http zu https durch Nginx Load Balancer
- 10. Google Load Balancer zwingen https
- 11. AWS ELB Redirect HTTP zu HTTPS ohne index.php
- 12. Kraft https und www auf AWS Load Balancer
- 13. Wie aktiviert man HTTPS auf AWS Elastic Load Balancer?
- 14. https kann nicht mit Elastic Load Balancer (AWS) arbeiten
- 15. Golan Redirect zu HTTPS in AWS
- 16. Https auf Elastic Beanstalk ohne Load Balancer
- 17. Spring Redirect-Befehl lenkt auf Localhost unter Load Balancer
- 18. Umleiten von HTTP zu HTTPS auf AWS Elastic Beanstalk Load Balancer mit zusätzlichen mod_rewrite Regeln
- 19. Amazon AWS Load Balancer Verfügbarkeitsproblem
- 20. AWS Load Balancer Whitelist Zugriff
- 21. HTTPS-Umleitung mit kubernetes l4 Load Balancer
- 22. AWS Beanstalk Load Balancer mit nicht HTTP-Port
- 23. Akka Http Client + Load Balancer
- 24. HTTP-Sitzung in Load Balancer
- 25. Symfony2 HTTPS Anforderung hinter EC2 Load Balancer
- 26. CodeIgniter mit Wordpress, https mit http, auf AWS mit Load Balancer, Wordpress Permalinks funktioniert nicht
- 27. Gibt es eine Möglichkeit, AWS Load Balancer zu filtern?
- 28. Laravel Redirect HTTPS zu HTTP
- 29. classic load balancer https acm ausgabe
- 30. Google Cloud http Load Balancer SSL-Terminierung
Dank! Das Problem wurde behoben – EvanL