Skip to content

Commit

Permalink
Return 404s and not 403s to prevent information disclosure.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanhamlin committed Apr 13, 2024
1 parent 3110018 commit 6d330bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion images/nginx-drupal/drupal.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ server {
return 403;
}

### Directives for installing drupal.
## Directives for installing drupal.
location ~* ^(/install.php|/core/install.php) {
try_files /dev/null @php;
}
Expand Down Expand Up @@ -111,34 +111,39 @@ server {
deny all;
access_log off;
log_not_found off;
return 404;
}

## Disallow access to backup directory.
location ^~ /backup/ {
deny all;
access_log off;
log_not_found off;
return 404;
}

## Disallow access to vagrant directory.
location ^~ /vagrant/ {
deny all;
access_log off;
log_not_found off;
return 404;
}

## Disallow access to vendor directory.
location ^~ /core/vendor/ {
deny all;
access_log off;
log_not_found off;
return 404;
}

## Disallow access to vendor directory.
location ^~ /vendor/ {
deny all;
access_log off;
log_not_found off;
return 404;
}

## Support for the robotstxt module
Expand Down

0 comments on commit 6d330bc

Please sign in to comment.