Some proxies can be configured to forward the real client address:

  - Apache ProxyPreserveHost Directive
      - Description: Use incoming Host HTTP request header for proxy request
      - Syntax: ProxyPreserveHost On|Off
      - Default: ProxyPreserveHost Off
      - Context: server config, virtual host
      - Status: Extension
      - Module: mod_proxy
      - Compatibility:  Available in Apache 2.0.31 and later.
    - mod_header directives:
      • RequestHeader set|append|add|unset header [value]
    - ProxyPass / http://backend.covalent.net
      • ProxyPassReverse / http://backend.covalent.net
      • RequestHeader set X-Forwarded-IP %{REMOTE_ADDR}e
      • RequestHeader set X-Request-Scheme %{REQUEST_SCHEME}e


> I want to get some information from request  header using something like the
> code bellow but for my requests I receive null.

You could use a debugger and see if the whole property map is null or
maybe the names are lowercase?

**
Martin

>
>
>
>                                HttpServletRequest request =
> ((ServletWebRequest) getRequest())
>
>
> .getHttpServletRequest();
>
>                                System.out.println("Http via:
> "+request.getHeader("HTTP_VIA"));
>
>                                System.out.println("Remote adr:
> "+request.getHeader("REMOTE_ADDR"));
>
>                                System.out.println("X_FORWARD adr:
> "+request.getHeader("HTTP_X_FORWARDED_FOR"));
>
>
>
>
>
> Can anyone tell me if there is other way to get all these information.
>
>
>
> In fact I want to get the ip address of the request. Using the
> request.getRemoteAddr() I receive only the proxy ip and not the real one.
>
>
>
> Thanks in advance!
>
> Tomike
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to