NGINX Configuration Structure
Zimbra NGINX Proxy has a hierarchical configuration structure. Top level configuration files include other functionality-specific configuration files. The main configuration file is /opt/zimbra/conf/nginx.conf, and this includes other configuration files as per the hierarchy below. Each configuration file usually defines and/or references one or more directives. For a complete list of NGINX Proxy Configuration Directives, please refer to NGINX Configuration Directive Reference
/opt/zimbra/conf/nginx.conf
This is the main top-level NGINX configuration file. It defines the working directory for NGINX worker processes (/opt/zimbra), and includes the main, memcache, mail, and web configuration files. When NGINX Proxy starts, it reads this configuration file first
/opt/zimbra/conf/nginx/includes/nginx.conf.main
This file contains the directives that control the basic NGINX functionality
/opt/zimbra/conf/nginx/includes/nginx.conf.memcache
This file contains the memcache configuration for NGINX. It defines all the memcache servers that are used by NGINX Proxy, and the various cache timeout related settings for cache fetch/store
/opt/zimbra/conf/nginx/includes/nginx.conf.mail
This file contains the common configuration for NGINX Mail Proxy. The directives referenced here are usually common across both, POP and IMAP. Significantly, this file defines the route lookup handlers used by NGINX to discover the mail routes
/opt/zimbra/conf/nginx/includes/nginx.conf.mail.imap
This file defines the server block for NGINX IMAP Proxy
/opt/zimbra/conf/nginx/includes/nginx.conf.mail.imaps
This file defines the server block for NGINX IMAP SSL Proxy
/opt/zimbra/conf/nginx/includes/nginx.conf.mail.pop3
This file defines the server block for NGINX POP3 Proxy
/opt/zimbra/conf/nginx/includes/nginx.conf.mail.pop3s
This file defines the server block for NGINX POP3 Proxy
/opt/zimbra/conf/nginx/includes/nginx.conf.web
This file contains the common configuration for NGINX Web Proxy. The directives here apply for both, HTTP, as well as HTTPS. This file also defines the route lookup handlers used by NGINX to discover the web routes
/opt/zimbra/conf/nginx/includes/nginx.conf.web.http
This file defines the server block for NGINX HTTP Proxy
/opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-<http,https,both,redirect,mixed>
The Zimbra Reverse Proxy Mail Mode is similar to the Web Server Mode, and can be one of http, https, both, redirect, or mixed. See Zmtlsctl for a definition of mail modes.
Depending upon the Reverse Proxy Mail Mode, the server block for HTTP may include exactly one of the following files:
- /opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-http
- /opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-https
- /opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-both
- /opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-redirect
- /opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-mixed
Each of these files contain the various rewrite rules required in order to implement the corresponding mail mode
/opt/zimbra/conf/nginx/includes/nginx.conf.web.https
This file defines the server block for NGINX HTTP SSL Proxy
/opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-<http,https,both,redirect,mixed>
Similar to the HTTP server configuration, the HTTP SSL configuration may also include exactly one of 5 mail mode files, which define the rewrite rules required to implement the corresponding mail mode