A
A
Alexey Tutubalin2015-12-21 21:52:49
Nginx
Alexey Tutubalin, 2015-12-21 21:52:49

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

2 answer(s)
A
Andrey Burov, 2015-12-21
@Kennius

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 :

S
sunrails, 2015-12-21
@sunrails

If you want to quickly, then stackoverflow.com/questions/29104943/how-to-disabl...
Well, the docks for understanding nginx.org/en/docs/http/request_processing.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question