A
A
advancess2020-11-26 09:12:49
Apache HTTP Server
advancess, 2020-11-26 09:12:49

How to fix wrong server response in HTTP_HOST parameter?

An incorrect response is received from the server in the HTTP_HOST parameter Does

5fbf473051917238697403.png

not see the fourth level subdomain. The site is on a dedicated server. If you transfer the site to a hosting where everything is automatically configured, then the response from the server comes correct

5fbf474e2ae25366363320.jpeg

Tell me how to fix it? where to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sand, 2020-11-26
@sand3001

Look here

V
Viktor Taran, 2020-11-26
@shambler81

this is due to, as I understand it, the bitrix vm or nginx + apache configuration,
as far as I understand, you have Apache on 9443 on the back
and in nignx the location is specified with the port
and everything works fine on port 80
In general, why this happens:
That's how it should be
http --> http
https --> https
how it is configured in all mana for nginx + apache
http --> http
https --> http and crutches for changing the protocol the
essence of such a crutch remains on the conscience of the one who proposed it, but in fact they appear here such hosts, since the port also gets into the variable.
well, if you have checks on the site on which protocol you are on, then having faked it on the front, the back does not know for sure about this and there are many other small crutches such as errors in htaccess, since the one with the protocols is generally tormented because he sees both at once.
fix the situation
nginx https: 443 --> apache : 4443 (for example) and substitute the same certificate both there and there.
This is how it should be:

location / {
                index index.php index.html index.htm;
                proxy_pass              https://127.0.0.1:4443;
                proxy_set_header        Host            $host;
                proxy_set_header        X-Real-IP       $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        HTTPS           YES;
                        }

You most likely have
proxy_pass              http://127.0.0.1:9443;
  proxy_set_header        Host            $host:9443;

in general, dig in this direction, more details after real configs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question