nginx 配置文件详解

创建日期: 2024-07-23 11:05 | 作者: 风波 | 浏览次数: 22 | 分类: Nginx

root 和 alias 的区别

参考:https://stackoverflow.com/questions/10631933/nginx-static-file-serving-confusion-with-root-alias

location /static/ {
    root /var/www/app/static/;
    autoindex off;
}

final path = /var/www/app/static/ + /static/ = /var/www/app/static/static

location /static/ {
    alias /var/www/app/static/;
    autoindex off;
}

final path = /var/www/app/static/ 替换 /static = /var/www/app/static

22 浏览
13 爬虫
0 评论