From dc47e660a885ca7f997564c59fb4a8ae863b0588 Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 13 Nov 2024 10:58:14 +0100 Subject: [PATCH] =?UTF-8?q?redirection=20par=20d=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env | 1 + services/10-nineapache/apache/apache.conf | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/env/.env b/env/.env index 5ce7ff8..cf4a0e1 100644 --- a/env/.env +++ b/env/.env @@ -14,6 +14,7 @@ RELEASE_SYSTEM=linux APP_ENV=PROD WEB_URL=nine.local PROTOCOLE=https +REDIRECT_PATH=/ninegate # ADMIN USER ADMIN_USER=admin diff --git a/services/10-nineapache/apache/apache.conf b/services/10-nineapache/apache/apache.conf index 20fac88..be32988 100644 --- a/services/10-nineapache/apache/apache.conf +++ b/services/10-nineapache/apache/apache.conf @@ -2,10 +2,16 @@ LoadModule rewrite_module modules/mod_rewrite.so ServerName nineapache.local +# Log des rewrite +# LogLevel alert rewrite:trace3 + +# Forcer https RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] + + # Options Proxy ProxyRequests Off ProxyPreserveHost On @@ -32,6 +38,11 @@ Alias /.well-known/acme-challenge /usr/local/apache2/htdocs/.well-known/acme-cha # Page interne au proxy DocumentRoot "/app/public" + # Rediriger la racine vers le chemin défini dans la variable REDIRECT_PATH + # en 302 pour que les navigateurs ne garde pas en cache la redirection + RewriteCond %{ENV:REDIRECT_PATH} !="" + RewriteRule ^/?$ %{ENV:REDIRECT_PATH} [R=302,L] + Options Indexes FollowSymLinks AllowOverride All Require all granted