T
T
Tarakkolya2014-09-23 21:55:08
Nginx
Tarakkolya, 2014-09-23 21:55:08

How to configure nginx so that it listens to requests by ip address and gives the page of my site instead of a welcome page?

I was able to do this only by writing in the virtual host configs listen :8080
and it turns out that the site returns only when accessed ip.ad.re.ss:8080
. Is it possible to somehow configure nginx so that the site is returned when accessing directly to the ip address on port 80?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Petrikov, 2014-09-23
@Tarakkolya

You can, there is nowhere easier, remove the server_name section from the settings of your virtual host, it will become default and will respond to requests by any name that is not explicitly set on nginx and by IP.

M
Maxim Vasiliev, 2014-09-23
@qmax

Write listen :80

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question