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