Back to tools

Web Config Validator

Common configuration errors by server

Knowing the most frequent errors for each web server will help you identify and fix them faster. This tool detects common syntax errors, but always test your configuration with the server's native command.

ServerTypical ErrorCauseSolution
NginxMissing semicolonForgot semicolon at end of directivesAdd semicolon after each directive
NginxDuplicate locationTwo location blocks with same pathMerge rules into one location block
ApacheMalformed VirtualHostMissing closing tag or improper nestingVerify each VirtualHost has matching close tag
ApacheInvalid commandMisspelled directive or disabled moduleEnable module with a2enmod or fix name
HAProxyUnknown keywordMisspelled keyword in directiveCheck keyword spelling
HAProxyMissing argumentBind directive without port specifiedAdd port to the bind directive

This tool is a basic static analysis and cannot detect all logical or configuration errors. Always complement with the server's native command.

Frequently Asked Questions

What are the most common errors in nginx.conf?

The most frequent Nginx errors include: missing semicolons at the end of directives like server_name or root; improperly closed location blocks; missing curly braces in regex expressions; incorrect file paths in ssl_certificate directives; and omitting the events block before defining server. It is also common to forget semicolons after lines containing file paths.

Why does Apache return "Syntax error on line X"?

Apache is very strict about syntax. Typical errors include: improperly nested VirtualHost blocks, unclosed directives, file paths with spaces missing quotes, <Directory> tags that do not close properly, and omitting the Require directive in access configurations. Malformed VirtualHosts (like forgetting </VirtualHost>) are the number one cause of Apache configuration errors.

What is the difference between validate and test in configuration?

Validation is a static analysis that checks basic file syntax, while testing runs the configuration in the actual server context, verifying that ports are available, referenced files exist, SSL certificates are valid, and required modules are loaded. "nginx -t" performs both operations. Our online validator catches syntax errors, but you should always run the server's native command for a complete check before reloading.

How to interpret HAProxy syntax errors?

HAProxy shows errors in the format "[ALERT] (pid) : parsing [file.cfg:line] : error message". Common errors include: "unknown keyword" (misspelled directive), "missing argument" (e.g., "bind" without a port), "duplicate name" (two backends with same name), and indentation errors since parameters inside blocks must be indented. A typo in "bind" (like "bnd") is a frequent mistake.

What command-line tools complement this validator?

Beyond our online validator, learn these native commands: "nginx -t" for Nginx (with "nginx -T" for full config dump), "apache2ctl configtest" or "httpd -t" for Apache, and "haproxy -c -f file.cfg" for HAProxy. For advanced debugging, combine "nginx -s reload" with error logs, and "systemctl status apache2" to view service errors. Tools like "grep" and "sed" help locate problematic lines in large files.

Can this validator detect logical or security configuration errors?

Our validator performs basic static analysis and can detect syntax errors, unbalanced parentheses, and invalid keywords. However, it cannot detect logical errors like misconfigured proxy rules, route conflicts, file permission issues, or security vulnerabilities like misconfigured SSL. For these cases, combine it with tools like SSL Labs, dedicated linters, or load testing.