Skip to content

Commit

Permalink
Merge pull request #1432 from alphagov/hostname-config-redux
Browse files Browse the repository at this point in the history
Configure hosts for application
  • Loading branch information
KludgeKML authored Oct 30, 2024
2 parents e02dbea + 8cd11fd commit d130f9c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@
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 = [
/local-links-manager\..*\.gov.uk$/,
"local-links-manager",
]

# 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

0 comments on commit d130f9c

Please sign in to comment.