Rewrite the referer header when using ngrok

Viewed 263

I want to create an ngrok tunnel to a router admin web interface that requires the Referer header to be set to the router's base URL, any request without the Referer set to (in my case) http://192.168.1.1/ will fail with a HTTP 403.

I've been trying to use the --request-header-add option:

ngrok http --request-header-add 'referer: http://192.168.1.1/' 192.168.1.1:80

but it complains about wrong format, since the value contains a colon in the http:// part:

ERROR:  Added request header should be in key:value format, got referer: http://192.168.1.1/
ERROR:
ERROR:  ERR_NGROK_370

Is there really no way to rewrite / add a referer header?

1 Answers

I had same issue with router (opnsense) and I fixed it be removing the referer header all together (as I did not find a way to set it using ngrok)

e.g.:

ngrok http --host-header=rewrite --request-header-remove 'referer' 192.168.1.1:80

Related