search

Home  >  Q&A  >  body text

java - web项目下的项目图片要怎么同步到本地提供给nginx作为静态资源访问

平时的项目里的图片都是上传到项目下的WebContent下面的,如果想让tomcat专注动态处理,让nginx处理这些图片资源,难道每次项目里上传图片都要做文件操作,把图片同步到类似/use/local/myimgs/这样的路径下吗?

PHPzPHPz2945 days ago347

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:29:26

    Set the java server upload location, and then nginx points to this location when setting the file path. Then you can use nginx to access these files. nginx will generate the access path based on the file path name, but the format is fixed, so the path can be known when java uploads.

    reply
    0
  • Cancelreply