For guacamole version 1.0.0 and above, you will need to configure RemoteIpValve
in your tomcat in order to see the source IP.
Firstly, make sure that your proxy send X-Forwarded-For
header. For example (in nginx):
location /guacamole/ {
proxy_pass http://HOSTNAME:8080/guacamole/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
access_log off;
}
Next, configure RemoteIpValve
in tomcat. It is used to pass through remote IP address to the application.
Go to tomcat conf
directory, and edit this file (conf/server.xml
). Under the <Host>
section, add the following:
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="127.0.0.1"
remoteIpHeader="x-forwarded-for"
remoteIpProxiesHeader="x-forwarded-by"
protocolHeader="x-forwarded-proto" />
For more info, you may refer to here:
Guacamole - Hostname logging within database