Back to Linter
Warningbest practice

No Root Path or Reverse Proxy

Why Nginx needs a root directive or proxy_pass to serve content.

What This Rule Checks

This rule detects when no locations are defined and the reverse proxy is disabled.

Why It Matters

Without a `root` directive (in locations) or a `proxy_pass`, Nginx doesn't know where to find files or where to forward requests. The server will return 404 for all requests.

Bad — Triggers this rule

server {
    listen 80;
    server_name example.com;
    # No root, no locations, no proxy — 404 for everything
}

Good — Passes this rule

server {
    listen 80;
    server_name example.com;
    root /var/www/html;

    location / {
        try_files $uri $uri/ =404;
    }
}

How to Fix

Add at least one location block with a root path, or enable reverse proxy in Configen's configuration.

Related Rules

Check your config now

Paste your nginx.conf and get instant feedback on 20+ rules.

Open Linter →