• Resolved Lee H

    (@leeh)


    In the description there’s these awesome Apache rewrite rules posted that drastically cut down on splog and user signups.

    Since moving servers and going with nginx (which I can confirm makes WP fly), I’ve been pummeled with bots creating splogs and user sign ups. I just can’t keep up with them.

    My Apache rewrite rule skills are weak at best, even after all these years, and this new nginx way of rewriting hasn’t even began to sink into my skull.

    Any kind souls able to convert this Apache rule to nginx?

    RewriteCond %{HTTP_COOKIE} !^.*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.*$
    RewriteRule ^wp-signup.php - [F,L]

    http://wordpress.org/extend/plugins/cookies-for-comments/

Viewing 1 replies (of 1 total)
  • Thread Starter Lee H

    (@leeh)

    Well that wasn’t so hard.
    I ended up making a location for wp-signup.php and wp-register.php.
    If the comments for cookies cookie isn’t set, a 403 Forbidden is returned.
    Sweet 🙂

    location ~ \wp-(signup|register).php$ {
    		if ($http_cookie !~ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") {
    			return 403;
    			break;
    		}
    		# Adjust for your setup
    		include fastcgi_params;
    		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    		fastcgi_pass php;
    	}

    If anyone knows a better way… I’m all ears!

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Cookies for Comments] nginx rewrite rule for cookies for comments. Anyone?’ is closed to new replies.