berrypod/config/prod.exs
jamey 0741095a84
All checks were successful
deploy / deploy (push) Successful in 3m38s
exclude /health from force_ssl redirect
Fly.io internal health checks are made over HTTP, so they get redirected
to HTTPS with a 301 which fails the health check. Exclude /health path
from SSL enforcement.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 10:06:26 +00:00

37 lines
1.4 KiB
Elixir

import Config
# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix assets.deploy` task,
# which you should run after static files are built and
# before starting your production server.
config :berrypod, BerrypodWeb.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json",
# HSTS tells browsers to always use HTTPS for this domain (1 year, include subdomains)
# This must be set at compile time, not runtime
# Exclude /health for Fly.io internal health checks (made over HTTP)
force_ssl: [
hsts: true,
rewrite_on: [:x_forwarded_proto],
exclude: [hosts: ["localhost", "127.0.0.1"], paths: ["/health"]]
]
# Configures Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Req
# Disable Swoosh Local Memory Storage
config :swoosh, local: false
# Do not print debug messages in production
config :logger, level: :info
# Structured JSON logs for production (machine-parseable by fly logs, journalctl, Loki, etc.)
config :logger, :default_handler, formatter: {LoggerJSON.Formatters.Basic, []}
# Persistent image cache and mockup variants on the Fly volume (survives deploys)
config :berrypod, :image_cache_dir, "/data/image_cache"
config :berrypod, :mockup_dir, "/data/mockups"
# Runtime production configuration, including reading
# of environment variables, is done on config/runtime.exs.