我需要为 Nginx 编写一个重写规则,以便如果用户尝试转到旧图像 url:
/images/path/to/image.png
并且文件不存在,尝试重定向到:
/website_images/path/to/image.png
仅当图像存在于新 URL 中时,否则继续 404。我们主机上的 Nginx 版本还没有 try_files。
rewrite nginx
nginx ×1
rewrite ×1