Nginx, Caddy, and Apache security config generator

Pass --fix-config nginx, --fix-config caddy, or --fix-config apache to turn actual findings from your scan into copy-paste server directives.

How config generation works

Instead of printing a generic boilerplate template, fix_config.rs reads the set of findings detected for your target URL (TLS-NO-HTTPS, HDR-HSTS-MISSING, HDR-CSP-MISSING, exposed dotfiles, and missing isolation headers) and prints only the directives needed to resolve them.

Generate and preview snippets locally

web-vuln-scanner https://example.com --fix-config nginx
web-vuln-scanner https://example.com --fix-config caddy
web-vuln-scanner https://example.com --fix-config apache

Example Nginx snippet emitted for missing headers

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Content-Security-Policy "default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
location ~ /\. { deny all; return 404; }

Frequently asked questions

Why does Nginx need always at the end of add_header?

By default Nginx omits add_header directives on 4xx and 5xx HTTP responses. Adding always makes security headers appear on error pages and API responses as well.

Does --fix-config edit server files on disk?

No. The scanner only prints the recommended block to stdout and includes it inside saved reports so operators review changes before reloading their proxy.

Related guides

OWASP security headers checker

Verify every directive after reloading Nginx, Caddy, or Apache.

CSP checker and generator

Tune Content Security Policy exceptions safely for web apps.

Exposed files and Git metadata scanner

Check whether dotfile deny rules block /.git/HEAD and /.env.