<div dir="ltr">Hello everyone,<div><br></div><div><div>My forum posts and attachments have been stolen much more by other site. and I write a nginx rule to prevent, without success, please guide.</div><div><br></div><div>example this forum:</div><div><a href="http://dysmyh.com/thread-41217-1-1.html">http://dysmyh.com/thread-41217-1-1.html</a></div><div><br></div><div>and my attachments url as</div><div><a href="http://www.cnprint.org/bbs/attachment.php?attachmentid=205810&d=1359965752">http://www.cnprint.org/bbs/attachment.php?attachmentid=205810&d=1359965752</a></div><div><br></div><div>and my forum domain is <a href="http://www.cnprint.org">www.cnprint.org</a>, and forum script put into /bbs/ directory.</div><div><br></div><div>now I forbidden others site show my attachment, this rule don't work, please help me.<br></div><div><br></div><div>I think should this line "location ~* ^/bbs/attachment+\.php?$" has mistake, but I can't resolve it.</div><div><br></div><div>location ~* ^/bbs/attachment+\.php?$</div><div>{</div><div>valid_referers none blocked *.<a href="http://cnprint.org">cnprint.org</a> server_names ~\.google\. ~\.baidu\. ~\.360\. ~\.bing\.;</div><div>if ($invalid_referer) {</div><div># return 403;</div><div>rewrite ^.*$ <a href="http://www.cnprint.org">http://www.cnprint.org</a>;</div><div>}</div><div>}</div></div></div>