Records the live shape after the 2026-11-10 production cut-over: the location lives inside the www nginx conf, access_log off is a privacy requirement rather than tuning, and X-Robots-Tag has exactly one source. The X-Robots-Tag note is a defect that was measured, not theorised: with both the app and nginx setting the header, a report answered with 'noindex, nofollow' AND 'index, follow' on the same response.
62 lines
3.4 KiB
Plaintext
62 lines
3.4 KiB
Plaintext
# Where the /check/ location actually lives
|
|
#
|
|
# The production location is NOT a separate file — it is part of
|
|
# www-hoelee-com/deploy/nginx/default.conf (the `location ^~ /check/` block plus the
|
|
# `$check_robots` map), because the www reverse proxy is the only thing that sees the public
|
|
# hostname. This file is the record of what that block must contain; it is not deployed as an
|
|
# include. Live file on the unRaid host:
|
|
# `/mnt/user/docker/www-hoelee-com/conf.d/default.conf`, bind-mounted read-only into
|
|
# `nginx-www-hoelee`. A change there needs a container RESTART (single-file bind mount = new
|
|
# inode), not `nginx -s reload`.
|
|
#
|
|
# Three properties are load-bearing, not stylistic:
|
|
# 1. `^~ /check/` — without it the `^/[a-z0-9][a-z0-9_-]{0,80}/?$` slug regex swallows /check
|
|
# and linkd answers 404.
|
|
# 2. `access_log off;` — an access log of /check/report/<domain> IS the query log the site
|
|
# promises not to keep. Verified 2026-11-10: a report request leaves no line in the
|
|
# container log, while ordinary page views still do.
|
|
# 3. Exactly one X-Robots-Tag, decided by the `$check_robots` map + `proxy_hide_header`. The
|
|
# service sets `noindex, nofollow` on report pages itself, so hiding it and letting nginx
|
|
# decide is the only way to avoid shipping `noindex` and `index, follow` together (measured).
|
|
#
|
|
# `proxy_pass $check` uses a variable for the same reason linkd does: a literal upstream name
|
|
# makes this container refuse to boot while the checker is being redeployed.
|
|
|
|
location ^~ /check/ {
|
|
access_log off;
|
|
|
|
proxy_pass $check;
|
|
proxy_http_version 1.1;
|
|
# $http_host, not $host: $host drops the port, so the LAN preview at :8082 would claim the
|
|
# wrong origin. X-Forwarded-For is overwritten, never appended — a client-settable first hop
|
|
# would let anyone mint a fresh rate-limit bucket per request.
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $hoelee_proto;
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
|
|
proxy_connect_timeout 5s;
|
|
proxy_send_timeout 20s;
|
|
proxy_read_timeout 20s;
|
|
|
|
proxy_hide_header X-Robots-Tag;
|
|
add_header X-Robots-Tag $check_robots always;
|
|
}
|
|
|
|
# Smoke tests after adding this (from any machine):
|
|
# curl -sS -o /dev/null -w '%{http_code}\n' https://www.hoelee.com/check/
|
|
# curl -sS https://www.hoelee.com/check/api/health
|
|
# curl -sS -o /dev/null -w '%{http_code} %{time_total}s\n' https://www.hoelee.com/check/report/hoelee.com
|
|
# curl -sSI https://www.hoelee.com/check/report/hoelee.com | grep -ci x-robots-tag # exactly 1, noindex
|
|
# curl -sSI https://www.hoelee.com/check/ | grep -i x-robots-tag # index, follow
|
|
# curl -sS -o /dev/null -w '%{http_code}\n' 'https://www.hoelee.com/check/?d=127.0.0.1' # 400
|
|
# for i in $(seq 1 12); do curl -s -o /dev/null -w '%{http_code} ' \
|
|
# 'https://www.hoelee.com/check/report/example.com?fresh=1'; done # 10x200 then 429
|
|
# curl -sSI https://www.hoelee.com/check | head -1 # 301 -> /check/
|
|
# # afterwards: confirm the container log holds no /check/report line
|
|
#
|
|
# `?fresh=1` is required for the rate-limit test: a cached report is served without spending a
|
|
# token (by design, so a WhatsApp or Telegram prefetch never becomes a fresh scan), so repeating
|
|
# a plain cached URL ten times proves nothing and looks like the limiter is broken.
|