Toolvito

Web Server Configuration Editor

Paste an nginx or Caddy configuration and the page checks it as you type: braces and semicolons, directives in the wrong place, and mistakes that stop nginx from starting, each with its line. Lay it out neatly, find out which location block answers a URL, or generate a reverse proxy or an .htaccess file. Nothing is uploaded.

Check and lay out a configuration

Which location answers a request (nginx)

Reverse proxy generator

.htaccess generator (Apache)

How to check an nginx configuration

  1. Paste the configuration (a whole nginx.conf, or a site file from sites-available or conf.d) into the box, or open the file.
  2. Read the line above the list: the number of errors, warnings and notes, and how the file was read.
  3. Press line … to jump to a problem. Press Lay it out for one directive per line with even indentation.
  4. Type a path under Which location answers a request to see the location block nginx chooses, and why.

What is checked

  • Syntax: quotes, a ; at the end of each directive (a missing one is found when the next line starts with a directive name), and { } blocks.
  • Places: each standard directive in the blocks where nginx allows it (listen in server, location in server or location, proxy_pass in location), and the number of values it takes.
  • Mistakes that stop nginx: proxy_pass with a path inside a regular-expression location, two default_server on one port, listen ... ssl without ssl_certificate, location modifiers other than = ~ ~* ^~, and regular expressions that cannot be read.
  • Warnings: unknown directives (from modules that may not be loaded), if inside location, root and alias together.
  • Caddyfile: { at the end of its line, } on its own line, blocks closed, and directives that are not standard.

Worked example

In the sample, the request /assets/logo.png is answered by location ^~ /assets/: it is the longest prefix that matches and it has ^~, so the regular expression ~* \.(png|jpg|svg)$ is not tried. The request /images/a.PNG is answered by the regular expression, because no ^~ prefix matches and ~* ignores case.

Limits you should know

  • The page cannot see the server: included files, certificate files, and which modules are loaded are not checked. Run nginx -t or caddy validate on the server before you reload.
  • The location test follows nginx’s documented order for one server; rewrite, return and try_files inside the block are not followed.
  • Directives of third-party modules are reported as unknown (a warning), not as errors.

Related tools