首先, 在linux下创建你存放资源的目录,例如:/data/images:用于存放图片。
下一步,打开default.conf配置文件找到server块下的location添加如下

location /images/ {
root /data;
}

注意:location 后面的路径名与最后一级目录名一致

参考资料:
http://nginx.org/en/docs/beginners_guide.html#static
https://www.cnblogs.com/jiongchen/p/9139156.html





相关文章:

  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2021-11-02
  • 2021-09-25
  • 2021-10-11
  • 2022-12-23
猜你喜欢
  • 2021-04-23
  • 2022-12-23
  • 2021-04-21
  • 2021-06-13
  • 2021-05-21
  • 2021-11-20
  • 2021-12-18
相关资源
相似解决方案