Redirect Zimbra Webmail from HTTP to HTTPS

Example scenario (illustrative only): An administrator manages two Zimbra Proxy hosts, and users still open webmail at http://mail.example.com. To redirect browser requests to HTTPS, set zimbraReverseProxyMailMode to redirect on every proxy serving the site, restart the proxy on each host, and verify that an unauthenticated HTTP request returns a 302 response with an HTTPS Location header.

Before changing anything, make sure the HTTPS endpoint already presents a trusted certificate for the public mail hostname. A redirect sends clients to HTTPS; it does not fix a broken certificate or protect credentials that a client may transmit before following the redirect. Zimbra specifically warns that some clients, including some ActiveSync clients, may not honor the 302 redirect. If every client must use encryption, consider HTTPS-only mode instead and test client compatibility first.

1. Identify every Zimbra Proxy host

Run Zimbra commands as the zimbra user. List the servers in the deployment, then inspect each proxy host’s enabled services and current web mode. Replace the example hostname with the actual proxy server name known to Zimbra:

su - zimbra
zmprov gas
zmprov gs proxy1.example.com zimbraServiceEnabled zimbraReverseProxyMailMode
A terminal listing Zimbra server hostnames, including two proxy nodes.
The illustrative host list shows two proxy nodes; apply the setting to each node that serves web traffic.

Repeat the server-level query for each host that has the proxy service. The HTTP mode is a server attribute, so changing one proxy does not automatically configure every other proxy node. If a load balancer distributes requests to two proxies, both need the intended setting.

A terminal reading the zimbraReverseProxyMailMode attribute, currently set to both.
This example shows the existing proxy mode; check the mode on every proxy before changing it.
A terminal confirming proxy1.example.com has the proxy service enabled.
Confirm that the selected server actually has the proxy service enabled before changing its web mode.

2. Confirm HTTPS works before redirecting traffic

From a client or a host with network access, request the public HTTPS URL without suppressing certificate errors:

curl -sS -D - -o /dev/null https://mail.example.com/

Check that TLS validation succeeds and the certificate is valid for the name users enter. The HTTP response may vary depending on the URL, authentication state, and release; the key prerequisite is a working HTTPS connection without a certificate warning. Also confirm the network path allows clients to reach the public HTTPS listener. A port check on the proxy can show local listeners, but it does not verify a firewall, load balancer, or public DNS record:

# Run as root if process details are needed
ss -lntp | grep -E ':80|:443'
A root terminal showing Nginx listeners on ports 80 and 443.
The example listener check shows HTTP and HTTPS ports; confirm the expected ports in your own deployment.

If HTTPS fails because the certificate is missing, expired, untrusted, or for another hostname, fix certificate deployment and routing first. Do not enable a redirect that sends every user to a broken HTTPS endpoint.

3. Set redirect mode on each proxy

As the zimbra user, set the server attribute on one proxy:

zmprov ms proxy1.example.com zimbraReverseProxyMailMode redirect
A Zimbra shell setting zimbraReverseProxyMailMode to redirect on proxy1.example.com.
The command sets redirect mode on one proxy host; repeat for each web-facing proxy.

Run the same command for each proxy node, substituting its Zimbra server name. Zimbra documents redirect as the proxy mode for sending HTTP web requests to HTTPS. The related modes serve different purposes: both accepts HTTP and HTTPS without forcing a redirect, while https is the HTTPS-only choice. Avoid changing zimbraMailMode on mailbox servers when your goal is only to redirect at the proxy; those are separate settings with separate service effects.

4. Restart the proxy and test the redirect

On each proxy, restart Nginx through Zimbra’s proxy control command so it reloads the configuration generated from the updated attribute:

su - zimbra
zmproxyctl restart
A Zimbra shell restarting the Nginx proxy service.
Restart the proxy after changing its mode so Nginx reloads the generated configuration.

Then test the HTTP URL without following redirects. The response should be a 302 redirect, and the Location header should point to the expected HTTPS hostname:

curl -sS -D - -o /dev/null http://mail.example.com/
A curl terminal showing an HTTP 302 response with a Location header pointing to HTTPS.
An unauthenticated HTTP request should return a redirect whose Location begins with the correct HTTPS hostname.

Now check the HTTPS endpoint. Keep certificate verification enabled; do not use -k for this validation because it hides trust and hostname problems.

curl -sS -o /dev/null -w 'HTTP %{http_code} | TLS verify %{ssl_verify_result}
' https://mail.example.com/
A curl terminal showing a successful HTTPS request and TLS verification result zero.
The example HTTPS check indicates certificate verification succeeded; actual HTTP status can vary by URL and authentication state.

A TLS verification result of 0 means curl accepted the certificate chain for that URL. The HTTP status may be a login response or another application response, so do not require one specific status code for every deployment.

5. Check all routes and client behavior

Repeat the HTTP and HTTPS checks against the public hostname after each proxy has restarted. If a load balancer is involved, verify that requests can reach every backend proxy and that its own redirect policy does not create a loop. In a deployment where an external load balancer terminates TLS, decide which layer owns the redirect and test the complete client-to-proxy path before enabling duplicate rules.

Finally, test the actual client types your organization supports. A browser should move from the HTTP address to the matching HTTPS address. A client that does not follow the redirect may fail or attempt an insecure initial authentication request. For strict transport security, Zimbra’s security guidance recommends setting the proxy mode to https rather than relying on a redirect; users and clients must then connect directly over HTTPS.

Sources

Leave a Comment

How to