Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use ngrok with puma-dev rails server

My rails app is spin up using puma-dev on Ubuntu.

I'm using puma-dev command to start my app (in foreground) and then access the rails app using https://app.test:9283. As the puma-dev is running in the foreground I have to use the port 9283 to access the port.

Now I want to access the rails app on remote machines like a mobile device or other PC. So have to use the ngrok to do so. I have installed ngrok in my ubuntu but I'm not able to access my localhost setup running on https://app.test:9283 using ngrok. Any help would be appreciated!

NOTE: When I use ./ngrok http 80 it successfully redirects me to localhost:80 which means ngrok is working properly.

like image 575
Tushar Bhutada Avatar asked Sep 20 '25 02:09

Tushar Bhutada


1 Answers

With puma-dev it is necessary to include the -host-header argument, like so:

./ngrok http -host-header=app.test 9283
like image 121
mrt Avatar answered Sep 22 '25 13:09

mrt