I can't use Google's HTTP load balance because it does not support web socket.
So my NGINX is running in Google Container Engine, behind Google Network Load Balance.
When the request arrives NGINX in docker container, it gets the IP of the NODE instead of the client ip.
2016/04/07 10:53:47 [error] 94#0: *73 access forbidden by rule, client: 10.132.0.9
How to solve this problem?
Getting the client IP when using Network Load balancer with Kubernetes is a known limitation. You can refer to this issue bug for updates and workarounds.
You get the IP of the "gce network load balancer" in the nginx logs?
since your question is not really clear, i presume your problem is in the nginx configuration.
try adding x-forwarded-for option in nginx.confmore clear: real_ip_header X-Forwarded-For;check the official google post https://cloud.google.com/solutions/https-load-balancing-nginx