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.

Error "Invalid Host Header"

See original GitHub issue

I’ve installed localtunnel on my mac and received a URL after running lt --port 8081. I get the error: “Invalid Host Header”. I didn’t add a subdomain because I’m not sure where to write that command… is it a separate command or added to the end of lt --port 8081 --subdomain my-intinerary or do I write lt --port 8081/#/my-intinerary alltogether? I’ve googled for answers, but I’m not sure how to run the commands (new to command line on Mac). Thanks.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

92reactions
riteshgrandhicommented, Sep 11, 2019

this fixed it for me: lt --port 3000 --subdomain my-app --local-host localhost

localtunnel’s --local-host parameter rewrites the host header similar to ngrok’s -host-header parameter: ngrok http 3000 -host-header="localhost:3000"

36reactions
c0d3r1010commented, Oct 5, 2018

If you are using a webpack dev server either directly or through some other framework like angular/cli you need to tell webpack’s dev server to disable host checks. For angular/cli you can disable this check when serving as follows: ng serve --disable-host-check

Hope that helps!

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 >
What is this “Invalid Host Header” error? | by Avinash Thakur
This error is most commonly caused by a misconfiguration of the application server that causes it to reject non-local connections.
Read more >
How to fix "Invalid Host Header" - RedwoodJS Community
When you run Redwood in dev mode, and would like to test the application as it is rendered from an external source (outside...
Read more >
Webpack Dev Server External Access - (Fix: Invalid Host ...
I faced this issue recently and, while I implemented the solution by reading the docs, I found that majority of the solutions in...
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 setup-ed SSL certificate using Let's Encrypt...
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