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.
No Comments