Retro.Phoenix.Plug.ProxySensation (Retro v1.0.2) View Source

Set endpoint base URL according to the proxy related headers.

Derive scheme from following headers:

  • x-forwarded-proto

Derive host from following headers:

  • x-forwarded-host
  • x-forwarded-server

Devrive port from following headers:

  • x-forwarded-port

Examples

iex> base_url(%Plug.Conn{req_headers: [ {"x-forwarded-host", "example.com"}, {"x-forwarded-proto", "https"} ]})
"https://example.com"

iex> base_url(%Plug.Conn{})
nil

Link to this section Summary

Link to this section Functions