Answer the question
In order to leave comments, you need to log in
How to deny access to the site by server ip?
There is a server on which the site is located, you can access it both by domain and by ip, but I don’t need to by ip, how can I ban it or, in extreme cases, do a 301 redirect?
Answer the question
In order to leave comments, you need to log in
nginx.org/ru/docs/http/request_processing.html
If its value does not match any of the server names, or the request header does not contain this field at all, nginx will forward the request to the default server for that port. In the configuration above, the default server will be the first server, which is the default behavior of nginx. The default server can be set explicitly using a parameter in the listendefault_server
directive :
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question