my server.xml

 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%a %l %u %t &quot;%r&quot; %s %b" />

        <Valve className="org.apache.catalina.valves.RemoteIpValve"
                internalProxies="127.0.0.1"
                remoteIpHeader="x-forwarded-for"
                remoteIpProxiesHeader="x-forwarded-by"
                protocolHeader="x-forwarded-proto" />

/var/log/tomcat9/catalina.out

[2022-01-06 09:54:35] [info] 09:54:35.449 [http-nio-8080-exec-7] INFO  
o.a.g.r.auth.AuthenticationService - User "guacaaduser" successfully 
authenticated from [192.168.16.48, 192.168.16.205]


display Remote Host in settings, history 192.168.16.205.


Debian 11, TomCat 9, MariaDB 15.1, Guacamole 1.4.0.


-Luciano

________________________________
De: Timo Nisula <[email protected]>
Enviado: quinta-feira, 6 de janeiro de 2022 09:00
Para: [email protected] <[email protected]>
Assunto: RE: Proxy reverse Caddy


Just tested myself also.



You need to modify tomcat server.xml as in mentioned in here 
https://guacamole.apache.org/doc/gug/reverse-proxy.html#setting-up-the-remote-ip-valve



I am running guacamole on rootless podman so I have copied 
/usr/local/tomcat/conf/server.xml file from container image and added following 
lines jus before where Host section ends. You need to of course set your own 
internalProxies value, this ip (10.0.2.100) is for rootless podman yours maybe 
127.0.0.1 (if in same host).



        <Valve className="org.apache.catalina.valves.RemoteIpValve"

               internalProxies="10.0.2.100"

               remoteIpHeader="x-forwarded-for"

               remoteIpProxiesHeader="x-forwarded-by"

               protocolHeader="x-forwarded-proto" />



I create guacamole with following command

podman run -dt --pod guac --name guacamole -v 
${PWD}/guac/server.xml:/usr/local/tomcat/conf/server.xml  
--env-file=${PWD}/.env-guac docker.io/guacamole/guacamole:1.4.0



-Timo



From: Luciano Oliveira <[email protected]>
Sent: torstai 6. tammikuuta 2022 13.39
To: [email protected]
Subject: RE: Proxy reverse Caddy



🙂



It really works great, but I'm still trying to display the remote host on 
Remote Host in settings, history



my /etc/caddy/Caddyfile



guacamole.domain.local:80 {

        rewrite / /guacamole

        uri strip_prefix /guacamole/*

        reverse_proxy guacamole.domain.local:8080

}



Accessing via tomcat, I have the remote host information, 
http://guacamole.domain.local:8080/guacamole/





-Luciano





________________________________

De: Timo Nisula 
<[email protected]<mailto:[email protected]>>
Enviado: quarta-feira, 5 de janeiro de 2022 13:54
Para: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Assunto: RE: Proxy reverse Caddy



I’m also interested using caddy v2. Yesterday I googled little bit and it 
should be really simple, not enough time test…

Doc https://caddyserver.com/docs/v2-upgrade#proxy



Reverse_proxy enables Host headers, X-Forwarded-For and websocket. So 
basically, following should be enough



guacamole.domaain.com {

    rewrite / /guacamole

    reverse_proxy /guacamole guacamole:8080

}

I will test this when I have little more time, perhaps on weekends.



-Timo





From: Luciano Oliveira <[email protected]<mailto:[email protected]>>
Sent: keskiviikko 5. tammikuuta 2022 18.42
To: [email protected]<mailto:[email protected]>
Subject: Proxy reverse Caddy



Anyone using Caddy as reverse proxy!?



thks




Reply via email to