question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid Host header

See original GitHub issue

Is this a bug report?

Yes

Environment

  1. node -v: v8.4.0
  2. npm -v: 5.4.2
  3. npm ls react-scripts (if you haven’t ejected): react-scripts@1.0.13

Then, specify:

  1. Operating system: Ubuntu 14.04 server
  2. Browser and version (if relevant): Chrome latest

Steps to Reproduce

(Write your steps here:)

  1. create-react-app client
  2. add “proxy”: “http://localhost:3001” to package.json
  3. npm start
  4. goto react url:port
  5. webpage reads “Invalid Host header”

Expected Behavior

React Test page loads

webpage does load with proxy setting removed.

Actual Behavior

webpage reads “Invalid Host header”

http://scotts.webhop.net:3000/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
godmarcommented, Apr 24, 2018

PS: I found the issue. I had an entry

127.0.0.1  my.fqdn localhost

in my /etc/hosts (Ubuntu 16.04 standard installation). This resulted in HOST being looked up as 127.0.0.1 and bound accordingly.

For those finding this article, note that the documentation says that there’s no security by default, the more strict checks kick in only if you specify a proxy.

1reaction
JeffWScottcommented, Sep 22, 2017

Sorry Joe, Thanks for the quick response!

That did not fix it, I got some error after I set the host about not finding a port for the proxy or something. I had to resort to disabling the check as I couldn’t get hung up on this at the moment. Close this and I’ll open an issue when I get back to it. Sorry,

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am getting an "Invalid Host header" message when ...
Most commonly this "Invalid Host header" issue comes up when trying to server to other clients on the network. After adding host: '0.0.0.0'...
Read more >
Webpack Dev Server External Access - (Fix: Invalid Host ...
Webpack Dev Server External Access - (Fix: Invalid Host Header) ... No, making host: '0.0.0.0' won't work. No, disableHostCheck won't work.
Read more >
What is this “Invalid Host Header” error? | by Avinash Thakur
In the course of testing an application hosted on your local machine, you may receive an “Invalid Host Header” error message when testing...
Read more >
"Invalid Host header" Error - DigitalOcean
I have deployed my server on ubunto-20x, tested it with IP address and was working fine. Then i added the domain name (from...
Read more >
Fix Invalid host header localtunnel on React, Angular - YouTube
... #angular #fixOption 1If you do not need to use Authentication you can add configs to ngrok commandsngrok http 3000 -- host -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found