I tend to test mobile stuff locally by connecting to my laptop from the device via Ngrok but was greeted with the following error message.
To allow requests to hostname, add the following to your environment configuration:
config.hosts « “hostname”
Rails 6 has added middleware that guards against DNS rebinding attacks.
To get around this error, you need to set the hosts in the environment config (development.rb).
config.hosts = '1d9sfs33ed0.ngrok.io'
config.hosts = ['1d9sfs33ed0.ngrok.io', 'localhost']
In theory, you shouldn’t have to set hosts in production.
If you have multiple hosts that keep changing, you might consider clearing the hosts altogether.