title: How to prevent redirect if image is embedded on page? [nginx]
body: <p>My nginx conf is set to reverse proxy port 8081 and to redirect if a user try to direct access any image by browser. However I do not want to redirect if a image is embedded on the page using <code>&lt;img src=&quot;&quot;/&gt;</code></p>
  <p>this is my nginx conf</p>
  <pre><code>location ~ &quot;^/c/600x1200_90_webp/img-master/img/\d+/\d+/\d+/\d+/\d+/\d+/((?&lt;filenum&gt;\d+)[^/]+\.(jpg|png|webp))$&quot; {
  proxy_pass http://xxx.xxx.xxx.xxx:8081;
  valid_referers server_names;
  if ($invalid_referer = &quot;1&quot;) {
  return 301 http://example.com/detail?id=$filenum; }
  }
  </code></pre>
  <p>How can I fix this cause it's redirecting the embedded images which I don't want?</p>