xin

Directive reference

root

Builds a filesystem path by appending the request URI.

Syntaxroot path;
Contextshttpserverlocationif in location
Defaultroot html;

Behavior

The path may contain variables. For a location whose URI prefix must be replaced rather than appended, use alias.

Example

location /images/ {
    root /srv/www;
}

Related directives

alias · index · try_files