Welcome! Log In Create A New Profile

Advanced

Re: Site should not be accessed through IP

April 09, 2015 02:40PM
If you're using a 1-config-per-site setup, then yes, you could. It
completely depends on your setup as to where you need to place it.

You can put it in any existing file that already has a server directive in
there. Just make sure none of the other server configs/files have the
default_server in their listen directive.

The server name of _ just makes sure it won't conflict with any existing
name as hostnames are not allowed to have underscores in them.

The default_server is special, it makes sure that any request that does not
have a matching name in the rest of the config will end up there. So not
just the IP that you asked for, but also any other website name that is not
in the config.

The 444 status code is just to return a "no response" kinda thing. If you
want you can even have a default site there, telling users there is no site
at that address with a fancy text and/or logo instead.
On Apr 9, 2015 8:30 PM, "blason" <nginx-forum@nginx.us> wrote:

> Hi Finalx,
>
> you mean shall I create the .conf file by name default_server and add up
> this there? Or would you please tell me where shoudl I add the above
> stanza?
> Sorry I am being novice in nginx just would like to know more information
> about this.
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,257927,257930#msg-257930
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Site should not be accessed through IP

blason April 09, 2015 02:09PM

Re: Site should not be accessed through IP

FinalX April 09, 2015 02:13PM

Re: Site should not be accessed through IP

blason April 09, 2015 02:30PM

Re: Site should not be accessed through IP

Sebastian Stabbert April 09, 2015 02:14PM

Re: Site should not be accessed through IP

FinalX April 09, 2015 02:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 319
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready