Skip to content

Commit

Permalink
Custom 503 page?
Browse files Browse the repository at this point in the history
- Trying to add a custom 503 page🤞
  • Loading branch information
MattHalloran committed Jul 16, 2024
1 parent 4457a07 commit dac99f9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 503.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>503 Service Unavailable</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; padding: 50px; }
h1 { color: #444; }
p { color: #666; }
</style>
</head>
<body>
<h1>503 Service Unavailable</h1>
<p>We're sorry, but our service is temporarily unavailable. Please try again later.</p>
</body>
</html>
11 changes: 11 additions & 0 deletions custom_error_pages.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server {
listen 80;
server_name _; # This will match any server name

error_page 503 /503.html;

location = /503.html {
root /usr/share/nginx/html;
internal;
}
}
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ services:
volumes:
- conf:/etc/nginx/conf.d
- ./my_proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro
- ./custom_error_pages.conf:/etc/nginx/conf.d/custom_error_pages.conf:ro
- ./503.html:/usr/share/nginx/html/503.html:ro
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- dhparam:/etc/nginx/dhparam
Expand Down

0 comments on commit dac99f9

Please sign in to comment.