From 32ea74ed0bae29bf54f63ffbec03d0d6a6645a86 Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Wed, 13 Dec 2023 16:24:24 +0100 Subject: [PATCH] Docker test: Middleware does not allow overriding the APP_ENV with an env var. Setting it in the Apache file for now. This will be fixed in the Symfony6 upgrade --- docker/Dockerfile.test | 2 +- docker/conf/middleware-test-apache2.conf | 34 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docker/conf/middleware-test-apache2.conf diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test index 79814328e..fba1f6b9a 100644 --- a/docker/Dockerfile.test +++ b/docker/Dockerfile.test @@ -8,7 +8,7 @@ COPY config/packages/prod/monolog.yaml.docker config/packages/prod/monolog.yaml # Add the config files for Apache2 RUN rm -rf /etc/apache2/sites-enabled/* -COPY ./docker/conf/middleware-apache2.conf /etc/apache2/sites-enabled/middleware.conf +COPY ./docker/conf/middleware-test-apache2.conf /etc/apache2/sites-enabled/middleware.conf # Recreate the cache directory and set the correct permissions RUN rm -rf /var/www/html/var/cache/prod && \ diff --git a/docker/conf/middleware-test-apache2.conf b/docker/conf/middleware-test-apache2.conf new file mode 100644 index 000000000..dd17631e1 --- /dev/null +++ b/docker/conf/middleware-test-apache2.conf @@ -0,0 +1,34 @@ + + ServerName middleware + ServerAdmin admin@surf.nl + + DocumentRoot /var/www/html/public + SetEnv HTTPS on + SetEnv APP_ENV test + SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 + + + Require all granted + + Options -MultiViews + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php [QSA,L] + + + Require all granted + + + Header always set X-Content-Type-Options "nosniff" + + # Set the php application handler so mod_php interpets the files + + SetHandler application/x-httpd-php + + + ExpiresActive on + ExpiresByType font/* "access plus 1 year" + ExpiresByType image/* "access plus 6 months" + ExpiresByType text/css "access plus 1 year" + ExpiresByType text/js "access plus 1 year" +