fix: 400 page appears when using http protocol to access

When using http protocol to access, nginx will respond with 400 and
report "400 The plain HTTP request was sent to HTTPS port".
The reason is that http 497 error[1] appeared in nginx, so 497
error was redirected to https protocol.

[1] 56f5331683/src/http/ngx_http_special_response.c (L274)

Change-Id: I01c35318dd5d219dbb31e6a89bdc05d2a4db7804
This commit is contained in:
Gao Hanxiang 2021-07-23 06:27:16 -04:00 committed by hanxiang gao
parent acf17c752b
commit 3176cfbc47

View File

@ -78,6 +78,8 @@ http {
server_name _;
error_page 497 https://$http_host$request_uri;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.