Skip to content

Commit f802620

Browse files
committed
Configure settings for fly.io SSL
1 parent b2e186f commit f802620

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

config/prod.exs

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ import Config
55
# manifest is generated by the `mix assets.deploy` task,
66
# which you should run after static files are built and
77
# before starting your production server.
8-
config :mjw, MjwWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
8+
config :mjw, MjwWeb.Endpoint,
9+
url: [host: "mahjongwind.com", port: 443, scheme: "https"],
10+
cache_static_manifest: "priv/static/cache_manifest.json",
11+
check_origin: ["//mahjongwind.com"],
12+
force_ssl: [
13+
host: nil,
14+
rewrite_on: [:x_forwarded_port, :x_forwarded_proto],
15+
hsts: true
16+
]
917

1018
# Configures Swoosh API Client
1119
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Mjw.Finch

config/runtime.exs

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import Config
1717
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
1818
# script that automatically sets the env var above.
1919
if System.get_env("PHX_SERVER") do
20-
config :mjw, MjwWeb.Endpoint, server: true
20+
config :mjw, MjwWeb.Endpoint,
21+
server: true,
22+
url: [host: "mahjongwind.com"]
2123
end
2224

2325
if config_env() == :prod do
@@ -50,7 +52,7 @@ if config_env() == :prod do
5052
You can generate one by calling: mix phx.gen.secret
5153
"""
5254

53-
host = System.get_env("PHX_HOST") || "example.com"
55+
host = System.get_env("PHX_HOST") || "mahjongwind.com"
5456
port = String.to_integer(System.get_env("PORT") || "4000")
5557

5658
config :mjw, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")

0 commit comments

Comments
 (0)