feat: enable Apache headers and rewrite module in Dockerfile; wrap header setting in .htaccess with IfModule check
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
FROM php:8.2-apache
|
FROM php:8.2-apache
|
||||||
|
|
||||||
|
RUN a2enmod headers rewrite
|
||||||
|
|
||||||
RUN docker-php-ext-install mysqli pdo pdo_mysql
|
RUN docker-php-ext-install mysqli pdo pdo_mysql
|
||||||
|
|
||||||
COPY . /var/www/html/
|
COPY . /var/www/html/
|
||||||
|
|||||||
@@ -9,5 +9,7 @@ Options -Indexes
|
|||||||
|
|
||||||
# Mencegah MIME sniffing
|
# Mencegah MIME sniffing
|
||||||
<FilesMatch "\.(jpg|jpeg|png)$">
|
<FilesMatch "\.(jpg|jpeg|png)$">
|
||||||
Header set X-Content-Type-Options "nosniff"
|
<IfModule mod_headers.c>
|
||||||
|
Header set X-Content-Type-Options "nosniff"
|
||||||
|
</IfModule>
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
Reference in New Issue
Block a user