diff --git a/Dockerfile b/Dockerfile index 6c97fbf..d96f1b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM php:8.1-apache -RUN a2enmod proxy && a2enmod rewrite +RUN a2enmod proxy && a2enmod rewrite && a2enmod headers EXPOSE 80 \ No newline at end of file diff --git a/README.md b/README.md index 11c9504..2bf6d9a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ System requirements: * PHP 7+ To run the site: -* `a2enmod proxy` and `a2enmod rewrite` to enable proxy pass and rewrite rules +* `a2enmod proxy`, `a2enmod rewrite` and `a2enmod headers` to enable proxy pass, rewrite rules and setting headers * Add the `000-default.conf` to the `sites-available` ### Setup with Docker @@ -18,7 +18,8 @@ To run the website using Docker, follow these steps: Use the provided `Dockerfile` and `docker-compose.yml` to build and start the containers. Execute the following command: ```sh -docker compose up +docker compose up --build +# --build makes sure to rebuild the image in case there were changes to the Dockerfile ``` Once the containers are up and running, you can access the website on port `8080`: diff --git a/etc/000-default.conf b/etc/000-default.conf index 85ecee0..8c0297d 100644 --- a/etc/000-default.conf +++ b/etc/000-default.conf @@ -26,6 +26,13 @@ SetHandler application/x-httpd-php + + # Make sure that CDN77 revalidates every 60 sec to prevent cache drift between builds and their shasum counterpart + + Header set Cache-Control "public, max-age=60, must-revalidate" + + + ProxyPass /admin/ws ws://localhost:8010/ws ProxyPassReverse /admin/ws ws://localhost:8010/ws ProxyPass /admin/ http://localhost:8010/