meteor-gke
meteor-gke copied to clipboard
Client ip address
Kubernetes load balancer overrides the source ip so the client ip is no longer accessible, given that, I don't see how kubernetes is or will ever be production ready.
Do you have a question or problem that needs solving or did you just want to leave that as a comment? :)
Do you have a way to get the original client's IP?
I'll chime in here. I'm trying to get the client's IP when running Meteor on Kubernetes behind an Nginx proxy service for SSL termination.
I've followed the instructions here: http://docs.meteor.com/#/full/meteor_onconnection
and changed HTTP_FORWARDED_COUNT
(tested out values for 1, 2, and 3), however the IP address returned is always either an internal IP address of a Kubernetes machine or the head Kubernetes cluster ip. It should return the client IP.
Here is the docker image for the Nginx container I'm running: https://github.com/markoshust/nginx-ssl-proxy/blob/master/nginx/proxy_ssl.conf
All of the headers appear to be set correctly and everything is functioning pretty well. Running Meteor 1.3.
I'm using https://github.com/mizzao/meteor-user-status to automatically store the client IP. I have this module working well on another site that runs a simple mup setup.
Either HTTP_FORWARDED_COUNT
is not working properly, or there is a misconfiguration somewhere.