Answer the question
In order to leave comments, you need to log in
I get an invalid host header nodejs error, how to fix it?
I am deploying a large application written in React to the server. Server on Ubuntu. And everything would be fine, but when I go through the domain (nginx proxies the request to the React application), an invalid host header appears on the screen.
I am not using webpack.
Answer the question
In order to leave comments, you need to log in
I suspect that the word redirects means proxies. In this case, the proxy_set_header
directive is missing.
As a result, it should turn out something like this:
location / {
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 X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8000/;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question