I'm using nginx. If my ip numbers are 184.108.40.206 and 220.127.116.11, how can I configure it to block requests for the ip numbers and only allow domains. If site1.com is configured for 18.104.22.168, I want to allow a request for site1.com but deny a request for 22.214.171.124.
You can create a default catch-all virtual host to serve requests for non-configured domains and do whatever you want with these requests. Something like this: