Answer the question
In order to leave comments, you need to log in
The site is accessible by IP NGINX. How to fix?
It turns out that I am a front-end developer, I understand the backend very poorly, but there is a task that I cannot find a solution to. If a site hosted on VDS, managed by BitrixVM and, as I understand it, using NGINX. Virtual server on CentOS 7. The problem is that it is possible to access the site by IP address, how can I disable IP access and redirect to the domain?
Answer the question
In order to leave comments, you need to log in
Blocking by ip:
server {
listen 80;
server_name "";
return 444;
}
If you need to redirect to a domain then:
server {
listen 80;
server_name "";
return 301 https://domain.local$request_uri;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question