Block an IP address

How to block an IP address

If your website comes under load from a bad IP address, use nginx to block it.

Edit (or create) the file /home/dokku/APP/nginx.conf.d/block.conf.

In that file, add the nginx deny setting for the IP, such as:

deny 10.20.30.40;

Validate the nginx config with:

sudo service nginx configtest

If nginx is happy, then reload nginx's config:

sudo service nginx reload

Further reading

Read more about the nginx access module for available settings.

Last updated