Skip to content

Commit 8b80f26

Browse files
authored
Add documentation to exclude paths (#6556)
1 parent 6f6a7d4 commit 8b80f26

File tree

2 files changed

+16
-4
lines changed
  • installer/templates

2 files changed

+16
-4
lines changed

installer/templates/phx_single/config/prod.exs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ import Config
99
config :<%= @web_app_name %>, <%= @endpoint_module %>, cache_static_manifest: "priv/static/cache_manifest.json"
1010

1111
<% end %># Force using SSL in production. This also sets the "strict-security-transport" header,
12-
# also known as HSTS. `:force_ssl` is required to be set at compile-time.
13-
config :<%= @web_app_name %>, <%= @endpoint_module %>, force_ssl: [rewrite_on: [:x_forwarded_proto]]<%= if @mailer do %>
12+
# known as HSTS. If you have a health check endpoint, you may want to exclude it below.
13+
# Note `:force_ssl` is required to be set at compile-time.
14+
config :<%= @web_app_name %>, <%= @endpoint_module %>,
15+
force_ssl: [rewrite_on: [:x_forwarded_proto]],
16+
exclude: [
17+
# paths: ["/health"],
18+
hosts: ["localhost", "127.0.0.1"]
19+
]<%= if @mailer do %>
1420

1521
# Configure Swoosh API Client
1622
config :swoosh, api_client: Swoosh.ApiClient.Req

installer/templates/phx_umbrella/apps/app_name_web/config/prod.exs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@ config :<%= @web_app_name %>, <%= @endpoint_module %>,
1010
cache_static_manifest: "priv/static/cache_manifest.json"
1111

1212
# Force using SSL in production. This also sets the "strict-security-transport" header,
13-
# also known as HSTS. `:force_ssl` is required to be set at compile-time.
14-
config :<%= @web_app_name %>, <%= @endpoint_module %>, force_ssl: [rewrite_on: [:x_forwarded_proto]]
13+
# known as HSTS. If you have a health check endpoint, you may want to exclude it below.
14+
# Note `:force_ssl` is required to be set at compile-time.
15+
config :<%= @web_app_name %>, <%= @endpoint_module %>,
16+
force_ssl: [rewrite_on: [:x_forwarded_proto]],
17+
exclude: [
18+
# paths: ["/health"],
19+
hosts: ["localhost", "127.0.0.1"]
20+
]

0 commit comments

Comments
 (0)