Hi all, in my umbrella app I’ve added this to my endpoint.ex file right after the “/” static plug:
plug Plug.Static,
at: "/.well-known",
from: {:faithful_word_api, "priv/static/well-known"},
gzip: false,
content_types: %{"apple-app-site-association" => "application/json"}
serves fine with this url locally: http://localhost:4000/.well-known/apple-app-site-association
but after deploying with a multi-stage docker release on a digital ocean vps(with http-> https routing performed by Traefik, behind cloudflare), the path https://blahblahblah.app/well-known/apple-app-site-association
results with this in the log:
faithful_word_umbrella | 13:30:39.055 [error] #PID<0.6413.0> running FaithfulWordApi.Endpoint (connection #PID<0.6409.0>, stream id 3) terminated
faithful_word_umbrella | Server: blahblahblah.app:80 (http)
faithful_word_umbrella | Request: GET /.well-known/apple-app-site-association
faithful_word_umbrella | ** (exit) an exception was raised:
faithful_word_umbrella | ** (Protocol.UndefinedError) protocol Phoenix.HTML.Safe not implemented for %{error: "unexpected"} of type Map. This protocol is implemented for the following type(s): Decimal, BitString, Atom, Float, Date, Time, Phoenix.HTML.Form, Integer, List, Tuple, DateTime, NaiveDateTime
faithful_word_umbrella | (phoenix_html) lib/phoenix_html/safe.ex:1: Phoenix.HTML.Safe.impl_for!/1
faithful_word_umbrella | (phoenix_html) lib/phoenix_html/safe.ex:15: Phoenix.HTML.Safe.to_iodata/1
faithful_word_umbrella | (phoenix) lib/phoenix/controller.ex:729: Phoenix.Controller.__put_render__/5
faithful_word_umbrella | (phoenix) lib/phoenix/endpoint/render_errors.ex:77: Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5
faithful_word_umbrella | (phoenix) lib/phoenix/endpoint/render_errors.ex:62: Phoenix.Endpoint.RenderErrors.__catch__/5
faithful_word_umbrella | (phoenix) lib/phoenix/endpoint/cowboy2_handler.ex:42: Phoenix.Endpoint.Cowboy2Handler.init/4
faithful_word_umbrella | (cowboy) /app/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2
faithful_word_umbrella | (cowboy) /app/deps/cowboy/src/cowboy_stream_h.erl:296: :cowboy_stream_h.execute/3
I checked the paths also:
root@edge-faithful-word:~/faithfulword-phx/apps/faithful_word_api/priv/static/well-known# ll
total 16
drwxr-xr-x 2 root root 4096 Feb 9 12:59 ./
drwxr-xr-x 3 root root 4096 Feb 9 12:59 ../
-rw-r--r-- 1 root docker 255 Feb 9 12:59 apple-app-site-association
-rw-r--r-- 1 root docker 292 Feb 9 12:59 assetlinks.json
The only thing that looks bogus to me is the docker
group ownership but not sure this matters because the permissions appear to be world readable.
Any other ideas? Deploying with Elixir 1.9.4(alpine). I happen to be using 1.10.0 in the dev env.