Skip to content

Commit bcd0391

Browse files
committed
Mention assume_ssl in SSL middleware.
Clarify that `assume_ssl` can be used with `force_ssl` to let the server know the request already is HTTPS.
1 parent e09dd95 commit bcd0391

File tree

1 file changed

+13
-3
lines changed
  • actionpack/lib/action_dispatch/middleware

1 file changed

+13
-3
lines changed

actionpack/lib/action_dispatch/middleware/ssl.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,26 @@ module ActionDispatch
1111
#
1212
# 1. **TLS redirect**: Permanently redirects `http://` requests to `https://`
1313
# with the same URL host, path, etc. Enabled by default. Set
14-
# `config.ssl_options` to modify the destination URL (e.g. `redirect: {
15-
# host: "secure.widgets.com", port: 8080 }`), or set `redirect: false` to
16-
# disable this feature.
14+
# `config.ssl_options` to modify the destination URL:
15+
#
16+
# config.ssl_options = { redirect: { host: "secure.widgets.com", port: 8080 }`
17+
#
18+
# Or set `redirect: false` to disable redirection.
1719
#
1820
# Requests can opt-out of redirection with `exclude`:
1921
#
2022
# config.ssl_options = { redirect: { exclude: -> request { /healthcheck/.match?(request.path) } } }
2123
#
2224
# Cookies will not be flagged as secure for excluded requests.
2325
#
26+
# When proxying through a load balancer that terminates SSL, the forwarded
27+
# request will appear as though it's HTTP instead of HTTPS to the application.
28+
# This makes redirects and cookie security target HTTP instead of HTTPS.
29+
# To make the server assume that the proxy already terminated SSL, and
30+
# that the request really is HTTPS, set `config.assume_ssl` to `true`:
31+
#
32+
# config.assume_ssl = true
33+
#
2434
# 2. **Secure cookies**: Sets the `secure` flag on cookies to tell browsers
2535
# they must not be sent along with `http://` requests. Enabled by default.
2636
# Set `config.ssl_options` with `secure_cookies: false` to disable this

0 commit comments

Comments
 (0)