tailon-legacy
tailon-legacy copied to clipboard
Using Apache for proxy
Hi,
Tailon seems exactly what I'm looking for but unfortunately I just can't get it to work behind a Apache proxy. I tried a couple of configurations but I only get it to work if I'm not using the '-r' option. But....then the css is not working. My Apache config is looking like this now:
<Location "/logs"> ProxyPass http://localhost:8090 ProxyPassReverse http://localhost:8090 ProxyPreserveHost On </Location>
Could you help me out here?
Best regards, Peter
You will need to proxy the /ws
path as well. For example:
ProxyPass /ws ws://localhost:8090/ws
ProxyPassReverse /ws ws://localhost:8090/ws
Don't forget, in order to proxy websockets, you will need the mod_proxy_wstunnel module installed and enabled.
I had to use a few extra rules to get the websocket forwarded:
I have tailon configured using: relative-root: '/logviewer/' and have tailon running in a docker container on 172.25.7.101:8080:
<Location "/logviewer">
ProxyPass "http://172.25.7.101:8080/logviewer"
ProxyPassReverse "http://172.25.7.101:8080/logviewer"
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule /ws/(.*) ws://172.25.7.101:8080/logviewer/ws/$1 [P]
</Location>
If you use the default relative root it would probably be as follows:
<Location "/">
ProxyPass "http://localhost:8080/"
ProxyPassReverse "http://localhost:8080/"
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule /ws/(.*) ws://localhost:8080/ws/$1 [P]
</Location>