Update blocked IP handling to use custom blocked page with 403 status
All checks were successful
HAProxy Manager Build and Push / Build-and-Push (push) Successful in 1m17s
All checks were successful
HAProxy Manager Build and Push / Build-and-Push (push) Successful in 1m17s
**Template Changes:** - Switch from direct denial to blocked page redirect with 403 status - Blocked IPs now see /blocked-ip page instead of generic 403 denial - Maintains proper 403 HTTP status code for blocked requests **Blocked Page Updates:** - Remove contact support button to prevent misuse - Add clear instructions on how to request unblocking - Provide structured guidance for contacting hosting provider - Maintain professional appearance with helpful information **Benefits:** - Better user experience for legitimate blocks - Clear instructions prevent support confusion - Maintains security while being informative - Professional appearance reflects well on hosting providers 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -41,21 +41,6 @@
|
|||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
.contact {
|
|
||||||
background: linear-gradient(135deg, #3498db, #2980b9);
|
|
||||||
color: white;
|
|
||||||
padding: 12px 24px;
|
|
||||||
border-radius: 6px;
|
|
||||||
text-decoration: none;
|
|
||||||
display: inline-block;
|
|
||||||
margin-top: 25px;
|
|
||||||
font-weight: 500;
|
|
||||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
||||||
}
|
|
||||||
.contact:hover {
|
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
|
|
||||||
}
|
|
||||||
.ip-info {
|
.ip-info {
|
||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
border: 1px solid #e9ecef;
|
border: 1px solid #e9ecef;
|
||||||
@@ -81,7 +66,7 @@
|
|||||||
<span class="icon">🚫</span>
|
<span class="icon">🚫</span>
|
||||||
<h1>Access Denied</h1>
|
<h1>Access Denied</h1>
|
||||||
<p>Your IP address has been blocked from accessing this website.</p>
|
<p>Your IP address has been blocked from accessing this website.</p>
|
||||||
<p>If you believe this block has been made in error, please contact our support team for assistance.</p>
|
<p>If you believe this block has been made in error, please contact support for assistance.</p>
|
||||||
|
|
||||||
<div class="error-code">
|
<div class="error-code">
|
||||||
Error Code: 403 - Forbidden
|
Error Code: 403 - Forbidden
|
||||||
@@ -93,7 +78,12 @@
|
|||||||
<strong>Domain:</strong> <span id="domain"></span>
|
<strong>Domain:</strong> <span id="domain"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="mailto:support@example.com" class="contact">Contact Support</a>
|
<div style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 20px; margin-top: 25px; color: #495057; text-align: left;">
|
||||||
|
<strong>To request unblocking:</strong><br>
|
||||||
|
• Contact your hosting provider's support team<br>
|
||||||
|
• Provide your IP address and the domain you're trying to access<br>
|
||||||
|
• Explain why you believe this block is in error
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@@ -7,8 +7,6 @@ frontend web
|
|||||||
# IP blocking using map file (no word limit, runtime updates supported)
|
# IP blocking using map file (no word limit, runtime updates supported)
|
||||||
# Map file: /etc/haproxy/blocked_ips.map
|
# Map file: /etc/haproxy/blocked_ips.map
|
||||||
# Runtime updates: echo "add map #0 IP_ADDRESS" | socat stdio /var/run/haproxy.sock
|
# Runtime updates: echo "add map #0 IP_ADDRESS" | socat stdio /var/run/haproxy.sock
|
||||||
http-request deny status 403 if { src -f /etc/haproxy/blocked_ips.map }
|
http-request set-path /blocked-ip if { src -f /etc/haproxy/blocked_ips.map }
|
||||||
|
http-request set-status 403 if { src -f /etc/haproxy/blocked_ips.map }
|
||||||
# Alternative: redirect blocked IPs to blocked page instead of deny
|
use_backend default-backend if { src -f /etc/haproxy/blocked_ips.map }
|
||||||
# http-request set-path /blocked-ip if { src -f /etc/haproxy/blocked_ips.map }
|
|
||||||
# use_backend default-backend if { src -f /etc/haproxy/blocked_ips.map }
|
|
||||||
|
Reference in New Issue
Block a user