Where is server{..} block?


#1

Noob alert! I’m following tutorial here: https://easyengine.io/tutorials/nginx/block-wp-login-php-bruteforce-attack/

and it says to add this to server block:

location = /wp-login.php {
    limit_req   zone=one  burst=1 nodelay;
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
}

so i add this to the where i think the server block is and when i restart nginx i get a fail. so i try other places in /etc/nginx/nginx.conf and i keep getting a fail?

the only server block i see in /etc/nginx/nginx.conf are these:

#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
#
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}

i need help, i’m completely stuck on this part. edit: I should also mention, when i remove the line of code i added to nginx.conf it restarts “ok”.


#2

It is in /etc/nginx/sites-available/domain.com.

I’d rather edit the vhost file with:

ee site edit domain.com

That’s because EE itself correctly reloads Nginx after editing the file, exempting us from nginx -t && service nginx reload.


#3

That works, thanks so much!


#4

thanks


#5