Skip to content

Commit

Permalink
Merge pull request #2277 from alphagov/add-hosts
Browse files Browse the repository at this point in the history
Configure hosts for application
  • Loading branch information
mtaylorgds authored Oct 24, 2024
2 parents 80dbef0 + 77c4ce4 commit 4695baf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,12 @@
config.active_record.dump_schema_after_migration = false

config.unreleased_features = ENV["UNRELEASED_FEATURES"].present?

# Enable DNS rebinding protection and other `Host` header attacks.
config.hosts = [
/collections-publisher\..*\.gov.uk/,
]

# Skip DNS rebinding protection for the default health check endpoint.
config.host_authorization = { exclude: ->(request) { request.path.match?("^\/healthcheck") } }
end

0 comments on commit 4695baf

Please sign in to comment.