How do I properly configure a server with nginx to front for a Zimbra server with multiple domains?
I run a small SOHO network. I NAT/port forwarding on my Comcast router to get traffic to my handful of servers.
I setup a server with Zimbra, call it host1.internal.local. The server currently has two domains, call them domain1.com and domain2.com. Both offer webmail access at webmail.domain1.com and webmail.domain2.com.
I have a separate server with nginx. I want to configure nginx to reverse proxy, such that I can direct all HTTP/HTTPS, and send webmail traffic via matched host address/headers to the Zimbra server. If possible, I'd like to know how to map IMAP, POP and SMTP traffic too.
How would I do this?
My http/https configuration using centos and nginx from the EPEL repo is as follows:
/etc/nginx/nginx.conf
/etc/nginx/conf.d/proxy.conf
The link below gives the full details of my centos and nginx configuration:
http://www.zen212739.zen.co.uk/centos5-5/pub-centos-rproxy-nginx-install.txt
I only use one domain for webmail access, but adding another domain to this nginx config should not be too difficult.
Using nginx for an imap proxy is a little more difficult so set up. I am still looking into this myself.
Smtp traffic needs a store and forward mail server. A separate postfix setup would probably be a better option.
I set up a intel atom based centos xen server with a few vm's to essentially the same thing that you are attempting to do.
server { listen 443 ssl; server_name subdomain.domain.com;
}