I’m having a heck of a time getting my config.hosts to work while using Rails 126.96.36.199. 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:
config.hosts << “my.domain.com”
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.