Keep nginx serving through a stalled worker, and gate Gitea's crawler targets
Test and deploy / deploy (push) Successful in 37s
Test and deploy / test (push) Successful in 1m13s

On 2026-10-19 nginx's only worker stalled for 4.6 hours. The master kept
the container "Up" and the tunnel stayed connected, so nothing noticed,
while every request timed out in the TLS handshake.

- worker_processes auto in the production and dev configs, so one stuck
  worker no longer takes the whole site down.
- A /nginx-health endpoint on :80 in all three configs, answered by nginx
  and unlogged, and a compose healthcheck on it.
- autoheal is back (retired 2026-10-01), pinned by digest, with no network,
  restarting only containers labelled autoheal=true: just nginx.
- Gitea's commit-pinned views, archives and compare pages go through the
  site admin gate. A swarm of 103k IPs made 129k requests to them in two
  days, 89% in those shapes; the branch views stay public for the CV links.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-19 19:15:38 +01:00
co-authored by Claude Opus 5.5
parent e5b19956a2
commit 66db14d0c5
8 changed files with 127 additions and 6 deletions
+18
View File
@@ -36,6 +36,15 @@
# (which carry the security headers), the `graphql` rate-limit zone and its
# location, and the limit_req_zone declarations the shared routes refer to.
# =============================================================================
# One worker per CPU. Unset, nginx runs a single worker, and on 2026-10-19 that
# one worker stalled for 4.6 hours: the master kept the container "Up" and the
# tunnel stayed connected, but every request timed out in the TLS handshake.
# With several workers a stuck one only loses the connections it holds; the
# others keep accepting. The healthcheck in docker-compose.yml (and autoheal
# restarting on it) covers the case where they all stall.
worker_processes auto;
events {
worker_connections 1024;
}
@@ -179,6 +188,15 @@ http {
root /var/www/certbot;
}
# The container healthcheck's target (docker-compose.yml). Answered by
# nginx itself, so it measures whether a worker is serving and nothing
# upstream. Unlogged, or it would put a line in the payload log every
# 30s. Every config's default :80 server has one, setup and dev too.
location = /nginx-health {
access_log off;
return 204;
}
# Redirect everything else to HTTPS
location / {
return 301 https://www.$DOMAIN$request_uri;