0

I am having an NGINX emergency where multiple websites are correctly defined as hosts with their URL set. The problem is when I make a default handler in NGINX all the SSL connections get redirected and fail. HTTP still works correctly with the default handler. I have specifically set server_name and yet it still redirects to default_sever.

server {
    listen       80  default_server;
    server_name  _;
    return       444;
}
server {
    listen       443 ssl default_server;
    server_name  _;
    return       444;
}
Ozfer
  • 1

1 Answers1

0

This kind of behavior might be due to incorrect configuration of SSL certificates. Try adding some kinds of certificates, like in this answer.

In my case, there was also something else missing:

ssl_session_tickets off;

Don't ask me why, without it the whole nginx was just broken. Nginx version 1.12.2.

The whole working example:

server {
    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;
    server_name _;

    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;
    ssl_session_tickets off;
    return 404;
}