NGINX Configuration Structure: Difference between revisions

No edit summary
 
(39 intermediate revisions by 3 users not shown)
Line 1: Line 1:
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]]
#REDIRECT [[Advance_Topics_For_Zimbra_Proxy_-_Configuration_And_Template_Files_And_Proxy_Related_Variables#Nginx_Configuration_Overview]]
 
Each NGINX configuration file is generated from a corresponding template file. A template file looks exactly the same as its corresponding configuration file, with the difference that the template file contains keywords which are expanded by the Proxy Config Generator, and the configuration file is produced as a result
 
= Configuration File Hierarchy =
 
/opt/zimbra/conf/nginx.conf
 
: → /opt/zimbra/conf/nginx/includes/nginx.conf.main
 
: → /opt/zimbra/conf/nginx/includes/nginx.conf.memcache
 
: → /opt/zimbra/conf/nginx/includes/nginx.conf.mail
 
:: → /opt/zimbra/conf/nginx/includes/nginx.conf.mail.imap
 
:: → /opt/zimbra/conf/nginx/includes/nginx.conf.mail.imaps
 
:: → /opt/zimbra/conf/nginx/includes/nginx.conf.mail.pop3
 
:: → /opt/zimbra/conf/nginx/includes/nginx.conf.mail.pop3s
 
: → /opt/zimbra/conf/nginx/includes/nginx.conf.web
 
:: → /opt/zimbra/conf/nginx/includes/nginx.conf.web.http
 
::: &rarr; /opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-<http,https,both,redirect,mixed>
 
:: &rarr; /opt/zimbra/conf/nginx/includes/nginx.conf.web.https
 
::: &rarr; /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-<http,https,both,redirect,mixed>
 
__NOTOC__
 
= Configuration Files =
 
* /opt/zimbra/conf/nginx.conf
 
: '''Description:''' 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
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.main
 
: '''Description:''' This file contains the directives that control the basic NGINX functionality
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.main.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.memcache
 
: '''Description:''' 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
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.memcache.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.mail
 
: '''Description:''' 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
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.mail.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.mail.imap
 
: '''Description:''' This file defines the server block for NGINX IMAP Proxy
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.mail.imap.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.mail.imaps
 
: '''Description:''' This file defines the server block for NGINX IMAP SSL Proxy
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.mail.imaps.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.mail.pop3
 
: '''Description:''' This file defines the server block for NGINX POP3 Proxy
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.template.pop3.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.mail.pop3s
 
: '''Description:''' This file defines the server block for NGINX POP3 SSL Proxy
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.mail.pop3s.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.web
 
: '''Description:''' 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
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.web.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.web.http
 
: '''Description:''' This file defines the server block for NGINX HTTP Proxy
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.web.http.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-<http,https,both,redirect,mixed>
 
: '''Description:''' 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
: '''Template:'''
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.http.mode-http.template
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.http.mode-https.template
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.http.mode-both.template
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.http.mode-redirect.template
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.http.mode-mixed.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.web.https
 
: '''Description:''' This file defines the server block for NGINX HTTP SSL Proxy
: '''Template:''' /opt/zimbra/conf/nginx/templates/nginx.conf.web.https.template
 
 
* /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-<http,https,both,redirect,mixed>
 
: '''Description:''' 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:
:: /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-http
:: /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-https
:: /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-both
:: /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-redirect
:: /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-mixed
 
: '''Template:'''
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.https.mode-http.template
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.https.mode-https.template
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.https.mode-both.template
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.https.mode-redirect.template
:: /opt/zimbra/conf/nginx/templates/nginx.conf.web.https.mode-mixed.template

Latest revision as of 18:10, 10 September 2014

Jump to: navigation, search