Hosting static files on Zimbra Proxy

To host static content such as logos or banners on the proxy node, we need to modify the nginx configuration files within ZCS. This is useful when implementing images on signatures in a multi-server installation. We are going to reuse an already existing folder on proxy nodes which sounds about right for the purpose.

On the proxy node:

1) Add logo files and other graphics needed within the /opt/zimbra/banners folder. You might need to create this folder, if so, please make sure it's owned by zimbra, group zimbra, and it's world-readable. The same applies to the files themselves.

2) We are now going to map a relative "logos" path so that URLs matching the rule will be caught and the local contents will be served. The next modifications have to be done, pay attention to the position within the files, since it matters:

/opt/zimbra/conf/nginx/templates/nginx.conf.web.http.template:

 [...]
   location = /50x.html {
   root   /opt/zimbra/banners;
   }
   location /logos/ {
       alias /opt/zimbra/banners/;
   }
 [...]


/opt/zimbra/conf/nginx/templates/nginx.conf.web.https.template:

  [...]
       # Fudge inter-mailbox redirects (kludge)
       proxy_redirect http://$relhost/ https://$http_host/;
   }
   location /logos/ {
       alias /opt/zimbra/banners/;
   }
 }

3) Rewrite the proxy configuration. As the zimbra user:

zmproxyconfgen

If you see no errors, then you can restart the proxy service:

zmproxyctl restart


Please take not of the above changes. These won't survive ZCS upgrades though, so take note of these changes.

4) Files can be now reached by going to http(s)://<proxyurl>/logos/<filename>, for example: logo.jpg

If you don't have a proxy (single server installation, or just no proxy) you might be interested in http://wiki.zimbra.com/wiki/Hosting_static_files_on_Zimbra_Mailbox_Store

Jump to: navigation, search