I’m having a heck of a time getting my config.hosts to work while using Rails 7.0.4.3. I have a deployed a standard set-up which I’ve done many times before, with nginx routing requests upstream to unicorn. After my initial deployment, I got the error message about a “Blocked host”.
"To allow requests to my.domain.com, add the following to your environment configuration:
I went ahead and added that exact line to my config/environments/production.rb file and redeployed. I’ve confirmed many times the app is running in production. But no matter what I do, I get the blocked hosts message.
I even went so far as to edit the actual gem code in my bundle, which is in the ActionDispatch::HostAuthorization class (identical to here: rails/host_authorization.rb at 7-0-stable · rails/rails · GitHub). I just have #authorized? return true no matter what.
Still no dice. I tried many variants of the configuration … config.hosts.clear, I tried to except certain request.paths, etc. Nothing works.
Thanks … I hadn’t, and it was certainly worth a shot. But didn’t work, either.
I feel like there is some odd caching behavior happening. I even kill unicorn, so the app itself isn’t running, and I still get that same Blocked Hosts response – even after I clear my browser cache.