brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: nginx -t checks your config before you reload

Nginx
~/tips/tip-nginx-t

sudo nginx -t && sudo systemctl reload nginx

Tests the nginx configuration for errors, so a typo does not take your sites down.

A reload with a broken config can leave you with a dead reverse proxy. Test first.

sudo nginx -t && sudo systemctl reload nginx

The && reloads only when the test passes. nginx -T (capital) also prints the full merged config, which helps when includes hide where a setting comes from. Inside a Docker container, run it with docker exec instead.

Further reading: nginx command line parameters

Going deeper: 🛜 Guide: AdGuard Home + Tailscale (Secure Split-Horizon DNS)

More Nginx tips sudo certbot --nginx -d example.com -d www.example.com /data/nginx/custom/server_redirect.conf map $http_upgrade $connection_upgrade { proxy_intercept_errors on; proxy_redirect http://localhost:3000/ /app/; All Nginx tips (50) All topics

Link