xin

Directive reference

alias

Replaces the matched location with a filesystem path.

Syntaxalias path;
Contextslocation
Defaultnone

Behavior

Unlike root, alias replaces the matched location prefix. In a regular-expression location, captures can be used in the path.

Example

location /downloads/ {
    alias /srv/files/;
}

Related directives

root · try_files