Hello guys,
I have a couple of question about the AWS Elastic Load Balancing (ipv4/ipv6) with a cluster of Phoenix.
My Conf:
elixir “~> 1.3.4”
phoenix “~> 1.2.1”
I do use an ASW Load Balancing + 2 servers running a Phoenix App. The App does have a little web site + API + web socket connection + cluster of nodes “link thanks, Chris”
The API is consuming by an iOS App and when you publish an app. Apple requires the service accept the protocol ipv6. So I modify the app config like this :
config :my_phoenix, MyPhoenix.Endpoint,
...
https: [port: {:system, "PORT_SSL"},
ip: {0, 0, 0, 0, 0, 0, 0, 0},
...,
...
- Question:
ip: {0, 0, 0, 0, 0, 0, 0, 0}
is correct to allow ipv6 and ipv4 in same time ?
After reading a lot how to set ipv6 on AWS link and also with Phoenix with Load balancer link.
And from the Plug.Conn docs:
peer - the actual TCP peer that connected, example: {{127, 0, 0, 1}, 12345}. Often this is not the actual IP and port of the client, but rather of a load-balancer or request-router.
remote_ip - the IP of the client, example: {151, 236, 219, 228}. This field is meant to be overwritten by plugs that understand e.g. the X-Forwarded-For header or HAProxy’s PROXY protocol. It defaults to peer’s IP.
- Question: I’m wondering if I should modify
Plug.Conn
to use the right IP or it will figure out by it self which IP is the right onepeer
orX-Forwarded-For
?
Thanks