Welcome! Log In Create A New Profile

Advanced

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Maxim Dounin
July 05, 2022 07:06PM
Hello!

On Tue, Jul 05, 2022 at 03:40:47PM -0400, milov wrote:

> В общем решил проблему.
>
> У меня на одном айпи висит несколько сайтов и в конфигах nginx прописано у
> двух сайтов default_server, оставил только у одного и проблема решилась.
> Возможно это баг какой-то и стоит куда-то сообщить.
>
> Странно только почему раньше работали редиректы )

Если у одного и того же listen-сокета используется флаг
default_server в двух разных блоках server{} - это фатальная
ошибка, nginx с таким конфигом работать не будет. В логах и при
тестировании конфигурации будет ошибка вида:

2022/07/06 01:40:43 [emerg] 900#100127: a duplicate default server for 0.0.0.0:8080 in ...

Если раньше работало - возможно, nginx не перезапускали, и он
работал со старым конфигом, до появления ошибки в конфиге.

Если же флаг default_server использовался у разных listen-сокетов,
то убрав его у одного из listen-сокетов вы просто изменили сервер
по умолчанию для этого listen-сокета. Это может исправить
проблему с "client sent plain HTTP request to HTTPS port", если
использовалась кривая конфигурация с "ssl on;" в блоке server с
listen-сокетами, которые не должны использовать SSL. Директива
"ssl" объявлена устаревшей 4 года назад, в nginx 1.15.0, причём
именно потому, что её использование легко приводит к подобным
ошибкам. Если директива "ssl" действительно используется -
конфигурацию следует переписать с использованием "listen ... ssl;"
вместо неё. Подробнее смотри http://nginx.org/r/ssl/ru и
http://nginx.org/r/listen/ru.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-ru mailing list -- nginx-ru@nginx.org
To unsubscribe send an email to nginx-ru-leave@nginx.org
Subject Author Posted

400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 05, 2022 05:49AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Илья Шипицин July 05, 2022 06:34AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 05, 2022 06:57AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Илья Шипицин July 05, 2022 07:16AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 05, 2022 02:12PM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Maxim Dounin July 05, 2022 08:56AM

certbot

Gena Makhomed July 05, 2022 03:10PM

Re: certbot

Maxim Dounin July 05, 2022 05:54PM

Re: certbot

Gena Makhomed July 06, 2022 02:02AM

Re: certbot

Maxim Dounin July 06, 2022 03:02PM

Re: certbot

Gena Makhomed July 06, 2022 04:40PM

Re: certbot

Maxim Dounin July 06, 2022 06:20PM

Re: certbot

Evgeniy Berdnikov July 07, 2022 05:20AM

Re: certbot

Илья Шипицин July 07, 2022 05:42AM

Re: certbot

Evgeniy Berdnikov July 07, 2022 06:16AM

Re: certbot

Илья Шипицин July 07, 2022 06:40AM

Re: certbot

Dmitry Morozovsky July 20, 2022 01:00PM

Re: certbot

Maxim Dounin July 20, 2022 04:02PM

Re: certbot

Илья Шипицин July 21, 2022 06:44AM

Re: certbot

Илья Шипицин July 21, 2022 06:48AM

OCSP Must Staple

Gena Makhomed July 21, 2022 07:06AM

Re: OCSP Must Staple

Илья Шипицин July 21, 2022 07:14AM

Re: OCSP Must Staple

Maxim Dounin July 21, 2022 09:30PM

Re: certbot

raven_kg@megaline.kg July 06, 2022 02:10AM

Re: certbot

milov July 06, 2022 04:49AM

Re: certbot

Илья Шипицин July 06, 2022 07:46AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 05, 2022 03:40PM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Maxim Dounin July 05, 2022 07:06PM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 05, 2022 07:20PM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Maxim Dounin July 05, 2022 09:54PM

long deprecated directives

Gena Makhomed July 06, 2022 01:18AM

Re: long deprecated directives

Maxim Konovalov July 06, 2022 02:30AM

Re: long deprecated directives

Maxim Dounin July 06, 2022 03:16PM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 06, 2022 04:44AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Maxim Dounin July 06, 2022 03:22PM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 07, 2022 04:34AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Антон Горлов via nginx-ru July 07, 2022 04:46AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 07, 2022 04:57AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Maxim Dounin July 07, 2022 03:16PM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

milov July 09, 2022 04:46AM

Re: 400 Bad Request The plain HTTP request was sent to HTTPS port

Maxim Dounin July 10, 2022 04:42AM

SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking

Gena Makhomed July 11, 2022 02:08PM

Re: SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking

Maxim Dounin July 11, 2022 09:26PM

Re: SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking

Sergey Kandaurov July 12, 2022 07:54AM

Re: SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking

Maxim Dounin July 12, 2022 10:00AM

[error] access forbidden by rule

Gena Makhomed July 12, 2022 09:48AM

Re: [error] access forbidden by rule

Илья Шипицин July 12, 2022 10:42AM

Re: [error] access forbidden by rule

Maxim Dounin July 12, 2022 10:52AM

Re: [error] access forbidden by rule

Gena Makhomed July 12, 2022 12:56PM

Re: [error] access forbidden by rule

Илья Шипицин July 12, 2022 01:14PM

[warn] a client request body is buffered to a temporary file

Gena Makhomed July 12, 2022 03:16PM

Re: [warn] a client request body is buffered to a temporary file

Илья Шипицин July 12, 2022 03:28PM

Re: [warn] a client request body is buffered to a temporary file

Gena Makhomed July 12, 2022 05:02PM

Re: [warn] a client request body is buffered to a temporary file

Илья Шипицин July 12, 2022 11:44PM

Re: [error] access forbidden by rule

Илья Шипицин July 12, 2022 01:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 244
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