How to prevent Hotlink of WP multisite on Nginx? (2 posts)

  1. FeelAndCoffee
    Posted 4 years ago #

    Hi everyone i'm using WordPress on a multisite network (previously WP MU) on a server that use Nginx 1.2.2, the configuration that i use is this: http://wordpress.org/support/topic/nginx-php-fpm-php-apc-wordpress-multisite-subdirectory-wp-super-cache/page/2?replies=59. And works perfect... just one little problem, the "Protection for Hotlink", that normaly i use on simple wordpress sites doesn't work here.

    The code that i use normaly is something like this, inside of "server {}":

    	location ~* ^.+\.(jpg|jpeg|gif|png)$ {
    	  valid_referers none blocked server_names ~(mysite.com|google.|yahoo.|bing.|anothersitemine.com);
    	  if ($invalid_referer) {
    		return 403;

    I don't have any idea how adapt this traditional protection of hotlink, to the WP MU configuration of http://wordpress.org/support/topic/nginx-php-fpm-php-apc-wordpress-multisite-subdirectory-wp-super-cache/page/2?replies=59.

    I hope someone can help me. Thanks for reading.

  2. That code should still work... Oh. Maybe you need to put in an additional location of the /wp-includes/ms-files.php file?

Topic Closed

This topic has been closed to new replies.

About this Topic