I am using zphisher. when i create a link to ngrok, the link is generated, but on opening it it says ngrok gateway error The server returned an invalid or incomplete HTTP response.
I got to know from ngrok error documentation that it is error 3004. they tell the error code and message but no possible way to fix the error. can someone help me please. I think my brother watches YouTube during his online classes and I want to conform it. No phishing. Please. I got absolutely no help from anywhere. Just one of my friend told me that i need an ngrok account for that. tried it, doesn't work.

- 341
- 1
- 2
- 4
7 Answers
After some time I got it fixed doing 2 things:
- Make sure my local site is http (not https)
- Running command
ngrok http -host-header=rewrite localhost:PORT

- 2,475
- 1
- 26
- 36

- 231
- 1
- 4
-
3As others have stated, you can host a local https site by using the full address instead of just the port: `ngrok http https://localhost:8433` – Russ Savage Feb 26 '22 at 06:06
If your site using https://localhost:port below really works for me
ngrok http https://localhost:port --host-header=rewrite

- 564
- 3
- 14
-
3Tried all kind of syntaxes, but appending `--host-header=rewrite` was the solution. – Michel Rummens Oct 15 '22 at 16:51
-
-
For me, this command worked when I was receiving the 3004 error message and trying to access HTTPS on https://localhost:3000
:
./ngrok http https://localhost:3000

- 609
- 8
- 11
-
4similarly, mind needed `ngrok http https://localhost:5001 -host-header="localhost:5001"` (as opposed to [microsoft docs](https://learn.microsoft.com/en-us/azure/azure-functions/functions-debug-event-grid-trigger-local) which suggests only `ngrok http -host-header=localhost 5001` was needed) – Joel Balmer Nov 30 '21 at 11:50
-
1
The solution is pretty straightforward. Use the localhost:port where your application is running. For example, my Jenkins app is running on
http://localhost:8080
I will run the command $ngrok http http://localhost:8080
Notice the http/https difference

- 1
- 1
my solution is using this command:
ngrok http "http://$(ip route get 1.2.3.4 | awk '{print $7}')"
your httpd.conf must listen to port 80 or you must add it in the command. my OS is arch linux.

- 1
- 1
error message: "loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://11111.ngrok-free.app/'. This request has been blocked; the content must be served over HTTPS."
I had the same problem with ngrok, my site was in https but all the inner requests were changed to http so for it to work I have changed the code in EasyAdmin Bundle , the file in in /vendor/easycorp/easyadmin-bundle/src/router/AdminUrlGenerator.php in line 267 after "$this->isInitialized = false;" we have to add the line $url = str_replace("http","https",$url);
and now it works for me.

- 1