Disable Caddy admin panel and http-to-https redirects

This commit is contained in:
Iam54r1n4
2025-02-05 22:35:12 +00:00
parent 16e832f46f
commit 9167f45c26

View File

@ -63,6 +63,15 @@ update_caddy_file() {
# Update the Caddyfile without the email directive # Update the Caddyfile without the email directive
cat <<EOL > "$config_file" cat <<EOL > "$config_file"
# Global configuration
{
# Disable admin panel of the Caddy
admin off
# Disable automatic HTTP to HTTPS redirects so the Caddy won't listen on port 80 (We need this port for other parts of the project)
auto_https disable_redirects
}
# Listen for incoming requests on the specified domain and port
$DOMAIN:$PORT { $DOMAIN:$PORT {
# Define a route to handle all requests starting with ROOT_PATH('/$ROOT_PATH/') # Define a route to handle all requests starting with ROOT_PATH('/$ROOT_PATH/')
route /$ROOT_PATH/* { route /$ROOT_PATH/* {