Score:0

How to not redirect if image is embeded using nginx?

cn flag

I currently have setup to redirect if a user direct access the image by browser. However I do not want to redirect if a image is embeded on the page using <img src=""/>

this is my nginx conf

location ~ "^/c/600x1200_90_webp/img-master/img/\d+/\d+/\d+/\d+/\d+/\d+/((?<filenum>\d+)[^/]+\.(jpg|png|webp))$" {
proxy_pass http://xxx.xxx.xxx.xxx:8081;
valid_referers server_names;
if ($invalid_referer = "1") {
return 301 http://example.com/detail?id=$filenum; }
}

How can I fix this?

us flag
Please add output of `nginx -T` for the full nginx configuration.
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.