![如果图像位于 nginx 的特定子目录中,如何不进行重定向?](https://linux22.com/image/776460/%E5%A6%82%E6%9E%9C%E5%9B%BE%E5%83%8F%E4%BD%8D%E4%BA%8E%20nginx%20%E7%9A%84%E7%89%B9%E5%AE%9A%E5%AD%90%E7%9B%AE%E5%BD%95%E4%B8%AD%EF%BC%8C%E5%A6%82%E4%BD%95%E4%B8%8D%E8%BF%9B%E8%A1%8C%E9%87%8D%E5%AE%9A%E5%90%91%EF%BC%9F.png)
我目前已配置为在用户尝试通过浏览器直接访问所有图像时进行重定向,但如果图像位于特定子目录中,我不希望它们重定向/static/favicon/
location ~* ^/(?<filenum>.*)\.(jpeg|jpg|png|webp)$ {
proxy_pass http://xxx.xxx.xxx.xxx:7492;
valid_referers example.com;
if ($invalid_referer = "1") {
add_header Cache-Control "no-cache";
return 301 https://example.com/$filenum;
}
}
如果图像位于,我怎样才能不让它重定向/static/favicon/