Retro.Phoenix.Plug.ProxySensation (Retro v2.2.0) 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

Derive port from following headers:

  • x-forwarded-port

Derive remote_ip from following headers:

  • x-real-ip


The :remote_ip is available as logger metadata. To see the IP address in your log output, configure your logger backends to include the :remote_ip metadata:

config :logger, :console,
  format: "$time $metadata[$level] $message
  metadata: [:request_id, :remote_ip]

Link to this section Summary

Link to this section Functions