Configuration for using Zammad behind an Apache2 Reverse Proxy

Hey everyone, just wanted to share what I ended up getting to work. I am using Zammad in a production environment behind an nginx proxy on a server running Plesk (instructions for how I did that here). Then, I needed to pull my install locally so that I could test the API integration using the proper users and access tokens before I went live.

Locally I use Apache 2.4.52 for development. I installed the same way using portainer. Then I ran into all kinds of issues once again setting it up. Same CSRF issues, websockets, etc. After about a day I was able to find a configuration that worked for my local setup by looking at other conversations on here, some Zammad’s own example Apache configuration, as well as their site’s documentation.

I figured I’d just share it in case it can help anyone else in the same situation as me in the future. There are some things missing from this like SSL configuration, logs, etc, but this was the important stuff it seemed:

<VirtualHost *:80>
    ServerName support.zammad.devo

    <IfModule proxy_module>
        ProxyPreserveHost on
        ProxyPass / http://127.0.0.1:8080/
        ProxyPassReverse / http://127.0.0.1:8080/
    </IfModule>
</VirtualHost>
<VirtualHost *:443>
    ServerName support.zammad.devo

    ProxyRequests Off
    ProxyPreserveHost On

    RequestHeader set X_FORWARDED_PROTO 'https'
    RequestHeader set X-Forwarded-Ssl on

    # legacy web socket server
    ProxyPass /ws ws://127.0.0.1:8080/ws
    ProxyPassReverse /ws ws://127.0.0.1:8080/ws

    # action cable
    ProxyPass /cable ws://127.0.0.1:8080/cable
    ProxyPassReverse /cable ws://127.0.0.1:8080/cable
    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/

    # change this line in an SSO setup
    RequestHeader unset X-Forwarded-Use
</VirtualHost>
1 Like