Skip to content

Commit

Permalink
feat: activate forbidden locations when the ENV is not local
Browse files Browse the repository at this point in the history
  • Loading branch information
Monska85 committed May 23, 2024
1 parent 52cb1b7 commit 9d6a624
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ if [ -n "${NGINX_BASIC_AUTH_USER}" ] && [ -n "${NGINX_BASIC_AUTH_PASS}" ]; then
fi
fi

# Activate the forbidden locations when the environment is not local
if [ "${ENV:-}" != "loc" ]; then
print "Activating the forbidden locations"
cp /templates/fragments/005-forbidden-locations.conf /etc/nginx/conf.d/fragments/005-forbidden-locations.conf
fi

# Activate HSTS header (default: off)
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
# The suggested value for the max-age is 63072000 (2 years).
Expand Down
3 changes: 3 additions & 0 deletions templates/fragments/005-forbidden-locations.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
location = /core/install.php {
return 403;
}

0 comments on commit 9d6a624

Please sign in to comment.