Hi,
I’m trying to setup a production server for my web app and I just can’t get it working.
So, I’m using releases and Caddy as a web server.
Here are my files
Caddyfile:
MYDOMAIN.COM
reverse_proxy :4000
prod.exs
use Mix.Config
config :MYAPPNAME, MYAPPNAMEWeb.Endpoint,
url: [host: “MYDOMAIN.COM”, port: 80],
cache_static_manifest: “priv/static/cache_manifest.json”
I followed the docs to create a release and all steps were successful but when I visit my website, there is a blank white page and in my server terminal I get the following message:
11:13:06.458 [error] #PID<0.3724.0> running MYAPPNAMEWeb.Endpoint (connection #PID<0.3723.0>, stream id 1) terminated
Server: MYDOMAIN.COM:80 (http)
Request: GET /
** (exit) an exception was raised:
** (ArgumentError) cookie store expects conn.secret_key_base to be at least 64 bytes
(plug 1.11.1) lib/plug/session/cookie.ex:206: Plug.Session.COOKIE.validate_secret_key_base/1
(plug 1.11.1) lib/plug/session/cookie.ex:198: Plug.Session.COOKIE.derive/3
(plug 1.11.1) lib/plug/session/cookie.ex:117: Plug.Session.COOKIE.put/4
(plug 1.11.1) lib/plug/session.ex:96: anonymous fn/3 in Plug.Session.before_send/2
(elixir 1.12.1) lib/enum.ex:2356: Enum.“-reduce/3-lists^foldl/2-0-”/3
(plug 1.11.1) lib/plug/conn.ex:1691: Plug.Conn.run_before_send/2
(plug 1.11.1) lib/plug/conn.ex:407: Plug.Conn.send_resp/1
(phoenix 1.5.9) lib/phoenix/endpoint/render_errors.ex:78: >Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5
Does anyone have any idea what could cause this?