0

My server hosts images, but the content of images have to be different for the same link and have to deepens on http referrer.

For example: Website 1 load image website1.jpg from www.example.com/123123/img.jpg
             Website 2 load image website2.jpg from www.example.com/123123/img.jpg

How can i manage do it using NGINX configuration?

UPDATE: I give you guys more details about whole idea:

Images loads on the pages:

www.not_my_website.com/123123/
www.not_my_website.com/456456/
www.not_my_website.com/686667/

I can't access to this site, but there can be images from my site.

<img src="www.example.com/123123/img.jpg"></img>

I need serve others images with the same htlm code based on page ID www.not_my_website.com/ID/).

Thanks for help.

1 Answers1

2

No, that's absurd. You can't do that at the configuration level and there are innumerable reasons it is a horrible idea.

The only way to effect something like that would be to write a CGI application that fetches them based on whatever you want. But, you really should explain why it's a bad idea to break convention like this - imagine the effect of caching proxies, browser caches, and all the other things that assume image content from a GET request is invariant across referrer changes. Also this is totally unsuitable for use as an authorization mechanism since the header can trivially be forged, so I hope that isn't your reasoning.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92