For each “listen” directive with a unique ip:port, add one server{}
block which contains “listen ip:port default_server; return 444;”
This seems to do the trick.
I expected there to be a way to do all of the IP addresses at once.
For each “listen” directive with a unique ip:port, add one server{}
block which contains “listen ip:port default_server; return 444;”
This seems to do the trick.
when I tried to add listen for port 443 it broke the https for requests
with the valid hostname as well.
disable http server for requests with unknown hosts
server {
listen IP:80 default_server;
listen IP:443 default_server; # breaks all https??
return 444;
}
what’s the trick to do the same for https without breaking the requests
for https://myhost/ ?
On Thu, Aug 20, 2015 at 03:55:51PM -0700, Igal @ Lucee.org wrote:
Hi there,
For each “listen” directive with a unique ip:port, add one server{}
block which contains “listen ip:port default_server; return 444;”
This seems to do the trick.
I expected there to be a way to do all of the IP addresses at once.
You can add all of the “listen … default_server;” directives into a
single server{}.
But the way nginx chooses which server{} to use to handle a request,
means that there is not a single “listen” directive that will catch
everything that you don’t want to go elsewhere.
SNI will help you with to have listen separate server_name on one IP
and have default_server.
I have SNI enabled (running on Windows and confirmed by calling $ nginx -V
not sure how to “use” that?
thanks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.