NGINX Configuration Structure

Revision as of 23:42, 3 December 2009 by Cfremon (talk | contribs) (Adding category)

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

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
→ /opt/zimbra/conf/nginx/includes/nginx.conf.web.http.mode-<http,https,both,redirect,mixed>
→ /opt/zimbra/conf/nginx/includes/nginx.conf.web.https
→ /opt/zimbra/conf/nginx/includes/nginx.conf.web.https.mode-<http,https,both,redirect,mixed>


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


Verified Against: ZCS 5.0.x Date Created: 9/8/2008
Article ID: https://wiki.zimbra.com/index.php?title=NGINX_Configuration_Structure Date Modified: 2009-12-03



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search