Encoding and Reverse Proxy with Zimbra

June 25th, 2012 | Categories: Networking, Technology

I found myself facing a strange issue while moving from my simple all-in-one VPS server to a more roomy Kimsufi 16G running ESXi 5.0.

I only have one IPv4 address so I am using Sophos UTM 9’s Web Application Firewall to spread out some sites to different backend servers.
This is working fine, I did have to switch to basic protection for Zimbra Webmail but that’s really a non-issue.

However during the IPv6 push I made yesterday, Zimbra Webmail went FUBAR in Firefox. Worked fine in Chrome and Safari.
After about 3 hours of troubleshooting were I went over all the possibilities (Maybe Firefox mixed IPv4 and IPv6 requests, …).
I tried disabling IPv6 on my local UTM. Firefox worked again :S disabling IPv4 and forcing IPv6 was broken.

Now satisfied it was not a Firefox issue, I zoned in on the reverse proxy. Because I run Z-Push I can’t use Zimbra’s Webmail directly.
After first simplifying my setup and forcing Zimbra to only serve on [::1]:8080 and reworking my reverse proxy and z-push configs I was confident nothing on the Zimbra end went wrong.

After some more time troubleshooting I noticed that the RP wasn’t properly setting the encoding and content-type for some strange .js.zgz files Zimbra was returning. The WAF in Sophos UTM 9 didn’t have this issue. After figuring out it was indeed a deflated javascript file I added the following to my reverse proxy vhost.

# Zimbra Webmail enconding hotfix
AddEncoding x-gzip .js.zgz
AddType application/gzip .js.zgz

Restarted HTTPD and… nothing! I then cleared the Firefox cache and bingo! It is working again.

Hopefully this is useful for some of you out there!

Comments are closed.