0

I'm using Google Cloud ESP endpoint, and I want the ESP proxy to forward the clients IPs to the backend service for analytics purposes. From the Google docs I found that I should use --add_request_header to add headers to the request, and from the envoy docs (ESP is based on envoy proxy) they say the remote client IP is in the variable x-envoy-external-address, so I want to know how combine all things together and pass the clients IPs to the backend service in the args section upon ESP startup?

Another thing, how to force HTTPS traffic only by the ESP? and will that redirect HTTP requests (clients) automatically to HTTPS?

Robert G
  • 1,583
  • 3
  • 13
Rabi
  • 147
  • 2
  • 12
  • Is this the documentation that you're referring to? https://cloud.google.com/endpoints/docs/openapi/specify-esp-v2-startup-options – Robert G Apr 05 '22 at 07:59
  • Yes, but that refers to the ESPv2 which uses envoy, and I'm actually using ESP which uses nginx, I made a custom nginx config like stated here https://cloud.google.com/endpoints/docs/openapi/custom-nginx?hl=en and the forwarding didn't work, when I check the Google cloud logs for my app the access log says RemoteAddr "127.0.0.1:35999" which means the client IP forwarding didn't work! – Rabi Apr 05 '22 at 20:13

0 Answers0