NGINX Configuration Tips: Difference between revisions

Line 23: Line 23:
The IP to domain mapping is done based on the '''zimbraVirtualIPAddress''' attribute of the domain.
The IP to domain mapping is done based on the '''zimbraVirtualIPAddress''' attribute of the domain.


If you want to set up virtualhosting for multiple domains, then follow these steps:
To set up virtualhosting for multiple domains, then follow these steps:


* For each domain, identify a set of proxy IP addresses that should be reverse mapped to this domain. Then, for each of these IP addresses, execute the command
* For each domain, identify a set of proxy IP addresses that should be reverse mapped to this domain. Then, for each of these IP addresses, execute the command
Line 32: Line 32:


'''NOTE''' The IP-to-domain mapping is a many-to-one relationship. That means, one domain can map to multiple IP addresses, but one IP address can only map to a single domain. Therefore, to set up domain completion for multiple domains, at least one separate IP address must be allocated for each domain, and the NGINX Proxy server(s) must accept connections on each of these IP addresses.
'''NOTE''' The IP-to-domain mapping is a many-to-one relationship. That means, one domain can map to multiple IP addresses, but one IP address can only map to a single domain. Therefore, to set up domain completion for multiple domains, at least one separate IP address must be allocated for each domain, and the NGINX Proxy server(s) must accept connections on each of these IP addresses.
In case of a single domain that needs to be appended to each unqualified login name, the global config attribute zimbraDefaultDomainName to the required domain name
: zmprov mcf zimbraDefaultDomainName <defaultdomain>

Revision as of 11:30, 10 September 2008

Many configuration parameters of NGINX can be customized. This page provides tips to take care of the most usual ways to customize NGINX configuration.

View/Modify Route Lookup Handlers (garpu)

The command zmprov garpu (get all reverse proxy urls) gives a list of all the route lookup handlers used by NGINX for mail/web route discovery.

zmprov garpu will list all the servers for which zimbraReverseProxyLookupTarget is TRUE.

Therefore, to add a server to the route lookup handler list, execute the command:

zmprov ms <server> zimbraReverseProxyLookupTarget TRUE

To remove a server from the route lookup handler list, execute the command:

zmprov ms <server> zimbraReverseProxyLookupTarget FALSE

NOTE: Only add servers running the mailbox service to the route lookup handler list. This is because the URL used by NGINX is of the form http://<server>:7072/service/extension/nginx-lookup - and this URL is handled by jetty.

Set up Virtual Hosting (Domain Completion) for Mail

For accounts authenticating without domain, NGINX internally suffixes @domain to the login name, by first looking up an existing domain by the IP address of the proxy interface where the connection came in. If no such domain is found, then NGINX falls back to the default domain name specified by the config attribute zimbraDefaultDomainName.

The IP to domain mapping is done based on the zimbraVirtualIPAddress attribute of the domain.

To set up virtualhosting for multiple domains, then follow these steps:

  • For each domain, identify a set of proxy IP addresses that should be reverse mapped to this domain. Then, for each of these IP addresses, execute the command
zmprov md <domain> +zimbraVirtualIPAddress 1.2.3.4
zmprov md <domain> +zimbraVirtualIPAddress 5.6.7.8
  • The above step will ensure that if a mail user logs in on Proxy IP 1.2.3.4, or on IP address 5.6.7.8, then @<domain> will automatically be suffixed to the login name

NOTE The IP-to-domain mapping is a many-to-one relationship. That means, one domain can map to multiple IP addresses, but one IP address can only map to a single domain. Therefore, to set up domain completion for multiple domains, at least one separate IP address must be allocated for each domain, and the NGINX Proxy server(s) must accept connections on each of these IP addresses.

In case of a single domain that needs to be appended to each unqualified login name, the global config attribute zimbraDefaultDomainName to the required domain name

zmprov mcf zimbraDefaultDomainName <defaultdomain>
Jump to: navigation, search