静态文件的 url 地址
http://10.0.1.241:8002/static/ComponentAttach/xxx.ini
使用 root 配置
nginx.conf
location /static/ComponentAttach {
root "C:/code/bom_system/upload/ComponentAttach";
}
访问硬盘的路径地址为
C:/code/bom_system/upload/ComponentAttach/static/ComponentAttach/xxx.ini
使用root问题:在磁盘查找文件的时候,会在 root 指定的路径后面再加上 uri 的地址,去获取资源。
使用 alias 配置
nginx.conf
location /static/ComponentAttach {
alias "C:/code/bom_system/upload/ComponentAttach";
}
访问硬盘的路径地址为
C:/code/bom_system/upload/ComponentAttach/xxx.ini