Quantcast
Channel: Nginx Forum - Other discussion
Viewing all articles
Browse latest Browse all 972

Practical Code rewrite/replace/Inject Into Pages

$
0
0
Hi Guys,

I'm currently working on this so i might have a solution in but i wanted to ask anyway.

Scenario:

Someone is hjacking your google rating by using hacked sites and remote website load.

example www.domain.com/product.html your site. Hijacking site www.domain2.com/product.php?url=product.html which in turns loads the content from your servers.
I can do refblock/iptables etc but that is no what i want.

What i want is to inject custom html/js/php code into the reply based on the site's domain. My though is to use the hijacking site and hijackers work against them by getting my traffic back via a custom java script/php injection.

The nginx that serves the request is a Reverse Proxy.

I was thinking using the sub_filter module. i add a block of js on my pages that does nothing by default and use the sub to change it based on referal_url.

Thanks!
Bogdan

Viewing all articles
Browse latest Browse all 972