Code and config

nginx config viewer

Drop nginx.conf or a site’s config to see its servers and locations, what each directive does, and mistakes nginx would refuse. Your browser opens it on your device: nothing is uploaded.

Opened on this device, never uploadedDrop or paste another file at any time

What you see

nginx config in the viewerWhat it does
At a glanceEach server’s names and ports, and where its locations send requests
CheckedA missing ;, a } never closed or never opened, a directive nginx refuses twice in one block, TLS 1.0 and 1.1, autoindex
Directives explainedWith their default and a link to nginx.org
Extensions.conf, .cnf, .ovpn
UploadNone: opened on your device

What is an nginx config file?

In short

nginx reads its settings from nginx.conf and the files it includes (sites-enabled, conf.d): directives ending in ; inside blocks such as http, server and location.

How to open an nginx config file

  1. Add your nginx config. Drop the file in the box, choose it or paste it.
  2. Look at it. Each server at a glance (names, ports, where requests go), the file colored with what each directive means and its default under it when you switch Explanations on, and errors nginx would refuse such as a missing ; or a } never closed.

Questions

Which location block does nginx use for a URL?

An exact = match wins outright. Otherwise nginx takes the longest matching prefix, then tries regular expressions (~ and ~*) in the order they are written; the first that matches wins, unless the prefix had ^~.

How do I check my nginx config?

Run nginx -t on the server: only nginx can say it accepts the file. This viewer finds what reading it shows, such as a missing ; and blocks never closed, before you get there.

Why does my nginx config say a directive is duplicate?

Many directives may appear only once in a block, such as root, proxy_pass and client_max_body_size. The list above the settings names both lines.

Is my file uploaded?

No. The viewer runs in your browser and opens the file on your device. Nothing is sent anywhere.

Can opening a file here damage it?

No. The viewer only reads the file: a browser gives a page no way to change it. If something goes wrong, the view stops and the file is as it was.

Related