1

I have read through the documentation (both API and Manual), and haven't seem to find any support by gwan for the X-Forwarded-For header. The only thing I have found that could be related was REMOTE_BIN_ADDR.

I know to get a client IP you can use REMOTE_ADDR however my gwan servers are behind a HA Proxy load balancer, which forwards the client IP via X-Forwarded-For.

Does Gwan not support this header?

John-Alan
  • 171
  • 7

1 Answers1

1

As far as we know, while widely used, the X-Forwarded-For HTTP header is not part of the RFCs. Some servers, like Nginx, are using alternatives because proxy servers can "chain" the client IP address, leading to unreliable results.

On a side note, keep in mind that HTTP headers providing an X-Forwarded-For value cannot be trusted... unless your own proxy is cleaning-up any previously setup value and adding its own. This makes this X-Forwarded-For header less useful than expected at first glance - and surely contributes to explain why Nginx felt the need to create its own.

G-WAN initially supported this header but we have removed this entry because we believe that it is redundant with the native G-WAN reverse-proxy and load-balancer (a feature that was implemented last year but which is still not documented as documenting and exporting the interfaces in a polished way takes time - and we want to merge this feature with protocol handlers, to simplify things).

Note that, right now, you can easily parse it from the HTTP headers exposed by G-WAN, either from a handler or from servlets.

Gil
  • 3,279
  • 1
  • 15
  • 25
  • Thanks Gil for filling me in, kinda of inconvenient to do it in a handler/script but like you said it's easily done. Is there any kind of timeline you have for the reverse-proxy/load balancer (just wondering) – John-Alan Mar 02 '13 at 03:11