Nginx require WordPress cookie for access

By

•

min read

My profile

Share this:
location ~ protected_directory/ {
	if ($http_cookie !~ "wordpress_logged_in") {
		return 403;
	}

	# TODO: your custom proxy here
}

Warning: this does NOT check if you have permission and/or actual ownership for the requested file. It only checks if you are logged in or not.

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *