Stop Confusing sites-available and sites-enabled (Nginx Guide)

Published: (December 6, 2025 at 02:29 PM EST)
1 min read
Source: Dev.to

Source: Dev.to

sites-available

sites-available holds all server block configuration files that could be used by nginx, regardless of whether they are active. Think of it as a library of possible site definitions.

sites-enabled

sites-enabled contains only the configurations that nginx loads. The files in this directory are symbolic links (symlinks) that point to the corresponding files in sites-available. If a configuration file has no symlink in sites-enabled, nginx ignores it.

Example directory layout

/etc/nginx/sites-available/
    config1
    config2
    config3

/etc/nginx/sites-enabled/
    config1 -> ../sites-available/config1
    config2 -> ../sites-available/config2

In this example, config1 and config2 are enabled because symlinks exist in sites-enabled. config3 is not enabled, as there is no symlink.

To enable a configuration that currently exists only in sites-available, create a symlink in sites-enabled:

ln -s /etc/nginx/sites-available/config3 /etc/nginx/sites-enabled/config3

After running the command, config3 becomes active the next time nginx reloads its configuration.

Now you should have a clear picture of how sites-available and sites-enabled work together in nginx.

Back to Blog

Related posts

Read more »