Ich habe einen Apache-Reverse-Proxy-Server mit http und https-Dienste. Ich möchte http zu https forcible umleiten. Was sollte ich konfigurieren die Konfigurationsdatei?Wie erzwinge Umleitung http zu https auf einem Apache Reverse-Proxy-Server?
0
A
Antwort
0
empfohlen und auch sicherer Weg ist mit Virtual:
<VirtualHost *:80>
ServerName www.example.com
Redirect permanent/https://www.example.com/
</VirtualHost>
oder
<VirtualHost *:80>
ServerName www.example.com
Redirect permanent /login https://www.example.com/login
</VirtualHost>
Der andere Weg ist mit mod_rewrite:
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context
Wie gesagt, empfiehlt Apache Virtualhost mit Konfig.
Beispiele entnommen aus:
Verwandte Themen
- 1. Erzwinge HTTP zu HTTPS Umleitung
- 2. Apache Umleitung http zu https ohne www
- 3. http zu https Umleitung auf Nginx
- 4. HTTP zu HTTPS Umleitung auf App Engine
- 5. Wordpress http zu https Umleitung
- 6. Umleitung funktioniert nicht in Apache, HTTP zu HTTPS
- 7. Probleme Umleitung von HTTP auf HTTPS
- 8. HTTPS zu HTTP Umleitung über .htaccess
- 9. http zu https Umleitung ohne www
- 10. ASP.NET Core-Umleitung http zu https
- 11. http zu https Umleitung in Yii Rahmen
- 12. Magento index.php 301 Umleitung http zu https
- 13. WordPress htaccess - Umleitung http zu https
- 14. Reverse-Proxy-Umleitung http zu https
- 15. Jelastic Nginx http zu https Umleitung
- 16. Auto-Umleitung basierend auf http oder https
- 17. Wie https umleiten: // www zu https: // und http: // www zu https: // und http: // zu https: //
- 18. HTTP-Umleitung zu HTTPS in einem anderen Port
- 19. Wie erzwinge ich HTTP zu HTTPS mit einer Ausnahme?
- 20. Wird HTTP-Umleitung zu https von einer Firewall blockiert?
- 21. .htaccess: Umleitung von http zu https außer auf einigen Seiten?
- 22. Apache HTTPS -> HTTP -> HTTPS 301 umleiten
- 23. Apache und Varnish http/https
- 24. http zu https Umleitung mit Apache2 funktioniert nicht
- 25. Apache-Umleitung von http zu https und nicht www zu www
- 26. Umleitung zu HTTPS funktioniert nicht auf phpMyAdmin
- 27. wie Apache-Proxy-HTTP-Anfragen an https
- 28. IIS HTTP to HTTPS relative Umleitung
- 29. Umleitung in CakePHP ssl Website Routen zu http nicht HTTPS
- 30. htaccess Umleitung www zu nicht-www und http zu https
Vielen Dank, es funktioniert, ich benutze Original Proxypass, aber es hat nicht funktioniert. –