Skip to content

Commit d410259

Browse files
Monska85Bladedu
andauthored
feat: activate forbidden locations when the ENV is not local (#116)
* feat: activate forbidden locations when the ENV is not local * Disabled update.php path. * Update templates/fragments/005-forbidden-locations.conf --------- Co-authored-by: Marco Primitivo <[email protected]>
1 parent 52cb1b7 commit d410259

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docker-entrypoint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ if [ -n "${NGINX_BASIC_AUTH_USER}" ] && [ -n "${NGINX_BASIC_AUTH_PASS}" ]; then
7272
fi
7373
fi
7474

75+
# Activate the forbidden locations when the environment is not local
76+
if [ "${ENV:-}" != "loc" ]; then
77+
print "Activating the forbidden locations"
78+
cp /templates/fragments/005-forbidden-locations.conf /etc/nginx/conf.d/fragments/005-forbidden-locations.conf
79+
fi
80+
7581
# Activate HSTS header (default: off)
7682
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
7783
# The suggested value for the max-age is 63072000 (2 years).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
location = /core/install.php {
2+
return 404;
3+
}
4+
5+
location = /update.php {
6+
return 404;
7+
}

0 commit comments

Comments
 (0)