Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,26 @@
# ca https://acme-staging-v02.api.letsencrypt.org/directory
# }


# Removing some headers for improved security:
header -Server

@noRedirect {
not path /maintenance.html
not path /offline.png
}
@maintenanceModeActive file {
root /srv
try_files maintenance.on
}
handle @maintenanceModeActive {
root * /srv
redir @noRedirect /maintenance.html
file_server {
status 503
}
}

# Serves static files, should be the same as `STATIC_ROOT` setting:
root * /var/www/django
file_server
Expand All @@ -21,6 +37,7 @@
not path /media/*
}


# Serving dynamic requests:
reverse_proxy @noStatic django:8000

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- ./caddy_data:/data
- ./caddy_config:/config
- ./var/log/caddy:/var/log/
- ./maintenance_mode/:/srv
restart: unless-stopped
ports:
- 80:80
Expand Down
19 changes: 19 additions & 0 deletions maintenance_mode/maintenance.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Codabench</title>
<style>
body {
width: 50em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<img src="offline.png" alt="offline">
<h1>The Codabench site is being upgraded...</h1>
<p>Sorry, the page you are looking for is currently unavailable because the site is undergoing maintenance.</p>
<p>Please try again later. Thank you.</p>
</body>
</html>
Binary file added maintenance_mode/offline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.