Welcome! Log In Create A New Profile

Advanced

nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7

Gena Makhomed
June 05, 2024 11:44AM
Здравствуйте, All!

есть такой конфиг:

# cat /etc/nginx/nginx.conf

events {
worker_connections 10240;
}

stream {
server {
listen [::]:443 bind default_server ssl;
listen 443 bind default_server ssl;
ssl_reject_handshake on;
}
}

при попытке его тестирования - получаю ошибку:

# nginx -t
nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7
nginx: configuration file /etc/nginx/nginx.conf test failed

если в конфиге поменять слово stream на http
- тогда тестирование конфига происходит без проблем.

почему такое отличие, это ошибка в nginx? можно ли ее исправить,
чтобы директива ssl_reject_handshake вела себя одинаково,
и в контексте http и в контексте stream?

workaround: ошибки не будет, если в блок server
в блоке stream добавить совершенно не нужную в данном
случае и бесполезную директиву proxy_pass 127.0.0.1:443;

используется бинарная сборка nginx/1.27.0 с сайта nginx.org

# dnf info nginx
Name : nginx
Epoch : 1
Version : 1.27.0
Release : 2.el9.ngx
Architecture : x86_64
Source : nginx-1.27.0-2.el9.ngx.src.rpm
From repo : nginx-mainline
Summary : High performance web server
URL : https://nginx.org/

--
Best regards,
Gena
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7

Gena Makhomed June 05, 2024 11:44AM

Re: nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7

Roman Arutyunyan June 27, 2024 09:04AM

Re: nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7

Roman Arutyunyan July 11, 2024 11:00AM

Re: nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7

Hennadii Makhomed July 11, 2024 12:48PM

Re: nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7

Roman Arutyunyan July 11, 2024 12:54PM

Re: nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7

Hennadii Makhomed July 11, 2024 02:26PM

Re: nginx: [emerg] no handler for server in /etc/nginx/nginx.conf:7

Hennadii Makhomed July 16, 2024 05:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 94
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready