Troubleshooting
Configuration Fails naati -t
Dump the full expanded configuration across all included files to spot misplaced blocks or conflicting server_names:
naati -T -c /etc/nginx/nginx.confunknown directive "...": Check the Directives Index and Modules Matrix — typically indicates a third-party/Lua module orload_module.
Permission Denied on Port 80 / 443 or PID File
- In rootless Docker or Kubernetes pods (
runAsNonRoot: true), useghcr.io/malotho/naati:unprivileged(listens on port8080, PID at/tmp/nginx.pid). - On systemd hosts, verify
/runand/var/log/naati(or/var/log/nginx) are writable by the configureduser.
Too Many Open Files (EMFILE / ENFILE)
Ensure both worker_rlimit_nofile in nginx.conf and systemd’s LimitNOFILE= exceed 2 × worker_connections (proxying consumes one client fd + one upstream fd per active request).
Upstream 502 Bad Gateway / 504 Gateway Timeout
- Enable
error_log ... info;temporarily on the failingserverorlocationto inspect the exact connect/read/TLS error. - Verify
proxy_ssl_server_name on;is set when proxying to HTTPS upstreams behind SNI. - If your upstream resolves to IPv6-only (
AAAA) addresses, addipv6=offonresolveruntil IPv6 upstream support lands.