Skip to content

Commit 18d9581

Browse files
authored
ENGCOM-4562: Secure errors directory #20212
2 parents 03748b7 + c17eec4 commit 18d9581

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

nginx.conf.sample

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ location /media/downloadable/ {
159159
location /media/import/ {
160160
deny all;
161161
}
162+
location /errors/ {
163+
location ~* \.xml$ {
164+
deny all;
165+
}
166+
}
162167

163168
# PHP entry point for main application
164169
location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ {
@@ -198,6 +203,6 @@ gzip_types
198203
gzip_vary on;
199204

200205
# Banned locations (only reached if the earlier PHP entry point regexes don't match)
201-
location ~* (\.php$|\.htaccess$|\.git) {
206+
location ~* (\.php$|\.phtml$|\.htaccess$|\.git) {
202207
deny all;
203208
}

pub/errors/.htaccess

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
Options None
2+
<FilesMatch "\.(xml|phtml)$">
3+
Deny from all
4+
</FilesMatch>
25
<IfModule mod_rewrite.c>
36
RewriteEngine Off
47
</IfModule>

0 commit comments

Comments
 (0)