I have installed an nginx controller in GKE (GCP) on a cluster and a rails app set up with a Rack Attack configuration for restricting access. We're having trouble getting the remote IP address of incoming requests. It keeps returning the ingress IP not the remote user's IP. I've found several mentions of this issue in various forms. It mentions adding a setting to the nginx proxy config. Having installed the nginx controller using the standard public files on github, I don't know how to reconfigure the proxy on this controller. How would I apply a new proxy config to this setup?
See ingress controller yaml below:
apiVersion: v1
kind: Service
metadata:
creationTimestamp: "2020-04-30T15:45:32Z"
labels:
app: nginx-ingress
chart: nginx-ingress-1.36.3
component: controller
heritage: Tiller
release: nginx-ingress
name: nginx-ingress-controller
namespace: nginx-ingress
resourceVersion: "113532709"
selfLink: /api/v1/namespaces/nginx-ingress/services/nginx-ingress-controller
uid: a045e8e8-8af9-11ea-8a88-42010a030a07
spec:
clusterIP: 10.163.8.100
externalTrafficPolicy: Cluster
ports:
- name: http
nodePort: 30487
port: 80
protocol: TCP
targetPort: http
- name: https
nodePort: 32616
port: 443
protocol: TCP
targetPort: https
selector:
app: nginx-ingress
app.kubernetes.io/component: controller
release: nginx-ingress
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer:
ingress:
- ip: x.x.x.x