Score:0

How to not redirect if images are located in specific subdirectory with nginx?

cn flag

I current;y have configured to redirect if a user tries to direct access images by browser for all images but I don't want them redirected if the images are located in a specific subdirectory which is /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; 
}
    }

How can I not make it redirect if the images are located in /static/favicon/

Richard Smith avatar
jp flag
What do you mean by *not redirect*? Not `proxy_pass` or not `return 301`?
TravelWhere avatar
cn flag
@RichardSmith I don't want `return 301` if image is located in `/static/favicon/`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.