Documentation for alias directive

slowgary nginx-forum at forum.nginx.org
Thu Jan 30 02:32:21 UTC 2020


I hope this is the appropriate place to report this. I struggled with using
the alias directive because I (incorrectly) assumed that it was relative to
root since all other parts of my nginx configs are. This is not mentioned in
the documentation, it'd be nice to see it there.

If I'm completely off base, please correct me. Below are examples of what
did and didn't work for me.

#THIS IS WRONG

server {
    root    /var/www;

    location /i/
    {
        alias    /images/;
    }
}

#THIS IS RIGHT

server {
    root    /var/www;

    location /i/
    {
        alias    /var/www/images/;
    }
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,286858,286858#msg-286858



More information about the nginx mailing list