meteor-gke icon indicating copy to clipboard operation
meteor-gke copied to clipboard

Client ip address

Open shaylevi2 opened this issue 9 years ago • 3 comments

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.

shaylevi2 avatar Nov 14 '15 16:11 shaylevi2

Do you have a question or problem that needs solving or did you just want to leave that as a comment? :)

Primigenus avatar Nov 14 '15 16:11 Primigenus

Do you have a way to get the original client's IP?

shaylevi2 avatar Nov 14 '15 19:11 shaylevi2

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.

markshust avatar Mar 30 '16 16:03 markshust