tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: ServletRequest.getRemoteHost() not working when Tomcat is behind Nginx (Nginx as a reverse proxy)
Date Wed, 09 Sep 2015 15:50:18 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Brian,

On 9/8/15 5:16 PM, Brian wrote:
> mmmmmm...... ... Well, so far I have always assumed that Tomcat
> itself has always made this effort (assuming that it is enabled to
> do so in the connector), so that when I execute the method I'm just
> retrieving the value. I'm I wrong?
> 
> In this case when using Nginx+Tomcat, I assume that Nginx already 
> made the effort to get the remoteHost value as well, so Tomcat
> just receives it and I just need to invoke the method to get it.
> Maybe I'm wrong here.

You have to enable the RemoteIPValve, which was specifically written
for this purpose:

http://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Proxies_Suppor
t

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJV8FU6AAoJEBzwKT+lPKRYhC0QALJWX08e7xiC85YFsUgm5Kn9
YLGtsJCwlRJLZKsJuI/5/a6d0LiQdCfhmNmZO+uk9uyzo2MSJchVcPOJzJ1EsDVx
Yu0U3TRV3FFkecJyEaIjkTJCAufR2tcV0KdUK1tCJ7KfLrLebwneVaIzfw1T/DM4
xW8fkAvCgueEyTteEVc9fUPc7ck/5+jEXV8DrFXE51gISJea79BWfTd5V/FTjK/D
kgteoRbPoLxlRnhUTaeAyT7qxbEiNX5hjZ498NsBOgZ4/qk+EkdVFXK9QdJ0drsP
FhvahJE19VtVuxFnI9EOfg/yiH+ZwE1xygfgZfYQ9SyyaUgIAWYXzLOUrlHUdVES
jprwk3UFcxDrv+fAkhFefHQDk2LdgPDm7/ZeYvU+cKbd17gPHkLfcl9cX75v5pk5
yDi+wnSjZY1sMHlglbwhJGfCtttRTkbV+isTKkL5DeU2+IJPZU2/K3/1d0iVygXv
bPf58cWjdas/1C+9IcWl8zRZjMv3iunzN92McdPwVkt3OR1izFiGAaB/qByzHGLA
IvkqEdcSdpgED34jDHRWtNkgnW17p628IbUL7PBsG/e+BPKSsRfM4cxkBZw8CUPj
jLdDEH8ENYcEBtids+baHdkWsdsRld5h8VwifaA935RB2NnGb2vyk8S1YqQa3gh5
g3QRGpgjesJBn+H7+DHd
=2AhX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message