tailon-legacy icon indicating copy to clipboard operation
tailon-legacy copied to clipboard

Using Apache for proxy

Open ploef opened this issue 8 years ago • 2 comments

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

ploef avatar Jun 25 '16 08:06 ploef

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.

jongles avatar Aug 13 '16 08:08 jongles

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>

dvut avatar Jun 06 '18 07:06 dvut