Answer the question
In order to leave comments, you need to log in
How to block access to the site by domain through the nginx config
At the moment, the site opens both at the domain.com domain and at the IP address 10.11.12.13. I need, using the nginx config, to close access to the site by domain so that it is available only at the IP address 10.11.12.13 and is not available at domain.com.
Thank you.
Answer the question
In order to leave comments, you need to log in
If there are no more sites (virtual hosts) on the server, then the following is needed: add server_name
with your ip
to the already existing virtual host config in the server section, and if there is server_name domain.com, remove it:
server {
server_name 10.11.12.13;
...
}
server {
listen 80;
server_name domain.com;
deny all;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question