M
M
Michael2020-02-05 15:21:55
Nginx
Michael, 2020-02-05 15:21:55

How to remove default site in nginx?

Actually, the question is this - there is a pool of sites on the VPS that work quite well for themselves via dns
, but if you access the server at its IP address, it gives a 404 error.
Hence 2 questions -
1. 404 from which site?
2. How can I generally disable the server's response to a direct IP call?

PS the default site config has been deleted, the html directory too, njix itself has been reloaded

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Michael, 2020-02-05
@happy-cat

So far, as a temporary option, I made a default file with contents, it seems like nothing is a solution, what do you think?

server {
server_name _;
listen *:80 default_server deferred;
return 444;
}

M
Mikhail, 2020-02-05
@RuComMarket

1.you have domain calls in your configs, so when you access ip without a domain, you get 404 - it means the server cannot find the requested data, because there is nowhere to look in this case
2.when you access the server, it will give you anyway answer, if you want to give emptiness, make a blank page by default, but I advise you to put the response code 404 on it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question