Hosting static files on Zimbra Proxy: Difference between revisions

No edit summary
No edit summary
Line 3: Line 3:


On the proxy node:
On the proxy node:
1) Add logo files and other graphics needed within the /opt/zimbra/banners folder.
 
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:
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:
Line 28: Line 29:
   }
   }


3) Restart service, configuration rewriting will occur. This won't survive ZCS upgrades though, so take note of these changes.
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:
4) Files can be now reached by going to http(s)://<proxyurl>/logos/<filename>, for example:

Revision as of 13:52, 4 December 2012

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