title: How to prevent Rails 6 from blocking my AWS EC2 instances?
body: <p>I have some Rails 6 applications, deployed at AWS, via Opsworks.</p>
  
  <p>After upgrading to Rails 6 the app blocks the health check of its own instance and it causes the load balancer to take the instance down. </p>
  
  <p>I would like to know how to whitelist all my EC2 instances automatically with dynamic IP addresses? Instead of adding one by one to config/application.rb?</p>
  
  <p>Thanks</p>
  
  <pre><code>Rails.application.configure do
    # Whitelist one hostname
    config.hosts &lt;&lt; "hostname"
    # Whitelist a test domain
    config.hosts &lt;&lt; /application\.local\Z/
    # config.hosts.clear 
  end
  </code></pre>