Kapitel 09/Premium Rohtext.md aktualisiert
This commit is contained in:
@@ -218,13 +218,25 @@ Beispiel: Für den Ordner `/var/www/webproject-prod` lautet die Konfigurationsda
|
||||
nano /etc/apache2/sites-available/webproject-prod.conf
|
||||
```
|
||||
|
||||
Füge in den `<VirtualHost *:80>`-Block folgende Zeilen ein:
|
||||
Füge in die Datei folgende Zeilen ein:
|
||||
|
||||
```apache
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTPS} off
|
||||
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
||||
<VirtualHost *:80>
|
||||
ServerName staging.meinprojekt.de
|
||||
DocumentRoot /var/www/staging
|
||||
|
||||
<Directory /var/www/staging>
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
```
|
||||
>[!NOTE]
|
||||
>**HTTPS-Redirect nur im Proxy**
|
||||
>Wenn dein Server hinter einem Reverse Proxy wie Nginx Proxy Manager betrieben wird, übernimmt der Proxy die HTTPS-Verschlüsselung und ggf. Weiterleitung von HTTP zu HTTPS.
|
||||
>In diesem Fall darfst du in Apache selbst keinen weiteren Redirect auf HTTPS konfigurieren, da Apache die Verbindung als HTTP wahrnimmt und sonst in eine Endlosschleife geht
|
||||
>→ Browser meldet dann ERR_TOO_MANY_REDIRECTS.
|
||||
|
||||
|
||||
Speichern und schließen.
|
||||
|
||||
@@ -287,9 +299,10 @@ Beispielinhalt:
|
||||
<VirtualHost *:80>
|
||||
ServerName shop.deinedomain.tld
|
||||
DocumentRoot /var/www/shop-prod
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTPS} off
|
||||
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
||||
<Directory /var/www/blog>
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user