V
V
vlog2021-11-27 22:40:41
Nginx
vlog, 2021-11-27 22:40:41

Access.log, nginx: Is it normal for "host" header to be empty in requests?

I continue to solve the problem with the site after installing ssl .
I noticed a pattern in access: requests like https://example.com/ , which I myself made to check, do not explicitly specify the host, instead of it there is a dash. If the request was to the server via IP or http, then the host in access is specified explicitly.
What can be caused, can it be the cause of the problem and how to solve it?

Request to http (before ssl connection):

5.164.32.113 - - [27/Nov/2021:00:57:47 +0300] "GET / HTTP/1.1" 200 19109 "http://new.example.com/news" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.85 YaBrowser/21.11.0.1996 Yowser/2.5 Safari/537.36"


Request to https:
5.164.32.113 - - [27/Nov/2021:22:34:09 +0300] "GET / HTTP/1.1" 301 178 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.85 YaBrowser/21.11.0.1996 Yowser/2.5 Safari/537.36"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AUser0, 2021-11-28
@AUser0

Judging by the logs, your Nginx returns a full-fledged page to an HTTP request, but does not return a page to an HTTPS request, but redirects (HTTP code 301) to another URL (which one is not shown in the logs). Look for where in configs or in scripts such a transfer is made, apparently it should not be.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question