# Serving static files from a phoenix API

**URL:** <https://forum.elixirforum.com/t/serving-static-files-from-a-phoenix-api/46089>\
**Category:** Questions\
**Tags:** phoenix, file-downloading\
**Created:** [February 16, 2022, 5:14pm UTC](https://forum.elixirforum.com/t/serving-static-files-from-a-phoenix-api/46089 "2022-02-16T17:14:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stefanchrobot](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stefanchrobot/32/7657_2.png) [@stefanchrobot](https://forum.elixirforum.com/u/stefanchrobot)\
**Post date:** [February 17, 2022, 8:48am UTC](https://forum.elixirforum.com/t/serving-static-files-from-a-phoenix-api/46089/3 "2022-02-17T08:48:13Z")

</div>

The default path for reading static files is `priv/static`, so you need to tweak it:

```elixir
plug Plug.Static,
    # Note the root path.
    at: "/.well-known",
    from: {:my_app, "priv/certificates"},
    gzip: false,
    only: ~w(apple)

```

But I’d suggest following @silverdr advice and put the files in the usual location. Assuming the actual file is called `apple`, try this:

- Put the file into static: `/priv/static/.well-known/apple`
- Use “standard” `Static` plug config:

```elixir
  plug Plug.Static,
    at: "/",
    from: :my_app,
    gzip: false,
    only: [".well-known"]

```

---

_[View the full topic](https://forum.elixirforum.com/t/serving-static-files-from-a-phoenix-api/46089)._
