diff --git a/config/environments/production.rb b/config/environments/production.rb index 910dd344..df0e472a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -85,10 +85,10 @@ } # 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 = [ + /content-data\..*\.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