Major Updates to Network and Load Balancing
This commit is contained in:
137
nginx/error-pages/error-502.html
Normal file
137
nginx/error-pages/error-502.html
Normal file
@@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Port Nimara - Service Temporarily Unavailable</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background-color: #f5f5f5;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.error-container {
|
||||
background-color: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
padding: 40px;
|
||||
max-width: 500px;
|
||||
text-align: center;
|
||||
}
|
||||
.logo {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
margin: 0 auto 20px;
|
||||
background-color: #387bca;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
font-size: 48px;
|
||||
font-weight: bold;
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
p {
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.status {
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
margin: 20px 0;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
.retry-button {
|
||||
background-color: #387bca;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 12px 24px;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
.retry-button:hover {
|
||||
background-color: #2d6aa8;
|
||||
}
|
||||
.spinner {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 3px solid rgba(56, 123, 202, 0.3);
|
||||
border-radius: 50%;
|
||||
border-top-color: #387bca;
|
||||
animation: spin 1s ease-in-out infinite;
|
||||
margin-right: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="error-container">
|
||||
<div class="logo">PN</div>
|
||||
<h1>Service Temporarily Unavailable</h1>
|
||||
<p>We're sorry, but the Port Nimara Client Portal is temporarily unavailable. This may be due to scheduled maintenance or a temporary issue.</p>
|
||||
|
||||
<div class="status">
|
||||
<span class="spinner"></span>
|
||||
<span id="status-text">The system is restarting. Please wait...</span>
|
||||
</div>
|
||||
|
||||
<p>The page will automatically refresh when the service is available.</p>
|
||||
|
||||
<button class="retry-button" onclick="location.reload()">Retry Now</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Auto-refresh every 5 seconds
|
||||
let retryCount = 0;
|
||||
const maxRetries = 60; // 5 minutes max
|
||||
|
||||
function checkHealth() {
|
||||
fetch('/api/health')
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
// Service is back up, reload the page
|
||||
location.reload();
|
||||
} else {
|
||||
retryCount++;
|
||||
if (retryCount > maxRetries) {
|
||||
document.getElementById('status-text').textContent = 'Service is taking longer than expected. Please contact support if the issue persists.';
|
||||
} else {
|
||||
document.getElementById('status-text').textContent = `Checking service status... (Attempt ${retryCount})`;
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
retryCount++;
|
||||
if (retryCount > maxRetries) {
|
||||
document.getElementById('status-text').textContent = 'Service is taking longer than expected. Please contact support if the issue persists.';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Check health every 5 seconds
|
||||
setInterval(checkHealth, 5000);
|
||||
|
||||
// Initial check after 2 seconds
|
||||
setTimeout(checkHealth, 2000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user