Skip to content

Commit 95f5ab6

Browse files
authored
Update healthcheck route SSL exclusion to specifically GET /health (#52)
Instead of any route that might have "health" in its name (e.g. `/patient/123/super-sensitive-health-records`).
1 parent c7e83fa commit 95f5ab6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app-rails/config/environments/production.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@
5454
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
5555
config.force_ssl = true
5656

57-
# Exclude healthcheck endpoint from force SSL since healthchecks should not go through
58-
# the reverse proxy.
57+
# Exclude healthcheck endpoint from force SSL since healthcheck requests can
58+
# come from internal network sources (e.g., a load balancer) that do not go
59+
# through the service's SSL-terminating reverse proxy.
60+
#
5961
# See https://api.rubyonrails.org/classes/ActionDispatch/SSL.html
60-
config.ssl_options = { redirect: { exclude: ->(request) { /health/.match?(request.path) } } }
62+
config.ssl_options = { redirect: { exclude: ->(request) { request.get? and request.path == "/health" } } }
6163

6264
# Log to STDOUT by default
6365
config.logger = ActiveSupport::Logger.new(STDOUT)

0 commit comments

Comments
 (0)