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 prints the whole merged config, every include file in one go

Nginx
~/tips/tip-nginx-dump-merged-config

sudo nginx -T | less

Prints the complete configuration nginx would load, with each included file marked.

When a site behaves oddly I want to read the configuration nginx really loaded, including everything pulled in by include.

sudo nginx -T | less
sudo nginx -T | grep -n server_name

-T tests the configuration like -t and then dumps the result to standard output, with every included file introduced by a comment such as # configuration file /etc/nginx/conf.d/site.conf:. Pipe it through grep to find which file sets a directive. The dump contains certificate paths and any passwords or tokens written in the config, so scrub it before pasting it into a bug report.

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