diff --git a/config/environments/production.rb b/config/environments/production.rb index b5e7ed8f..a75ece3a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -84,10 +84,10 @@ config.active_record.dump_schema_after_migration = false # Enable DNS rebinding protection and other `Host` header attacks. - # config.hosts = [ - # "example.com", # Allow requests from example.com - # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` - # ] + config.hosts = [ + /contacts-admin\..*gov.uk?/, + ] + # Skip DNS rebinding protection for the default health check endpoint. - # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } + config.host_authorization = { exclude: ->(request) { request.path.match?("^\/healthcheck") } } end