Forwarding remote IP to Phoenix

Опубликовано: 20 Июнь 2026
на канале: Alchemist Camp
500
5

Follow me on Twitter to get more tips and tutorials!   / alchemistcamp  

https://alchemist.camp/episodes/forwa...

If you're running Phoenix behind an Nginx proxy you may see that your conn.remote_ip is always {127, 0, 0, 1}. That's because Nginx and Phoenix are running on the same host.

There's a standard for forwarding the remote_ip in cases like this and there's an Elixir library to do it. In this episode, we set it up, refactor it to get rid of Elixir 1.5 deprecation warnings and verify everything is working via ngrok.