NGINX Settings

Edit the templates that drive NGINX for every hosted domain. This page is available only when NGINX or NGINX+Apache is installed. Changes here affect global behavior and vhost generation.

Access: root only.

Tabs

  • nginx.conf Template — core server configuration.
  • VirtualHost Template — default vhost for standard domains.
  • Cache Template — vhost with proxy caching enabled.
  • Proxy VirtualHost Template — vhost when NGINX reverse-proxies to upstreams.

nginx.conf Template

  • What it is: base config for user, worker/process limits, events, log paths, buffers, and HTTP defaults.
  • Variables: placeholders (for example {{ user_vhost_path }}) are rendered automatically; do not hardcode resolved paths or ports.
  • Editor: template loads into a code area (max 1 MB). Saving creates a backup and runs a validate/apply step.
  • Apply: “Validate & Apply Changes” rebuilds /etc/nginx/nginx.conf from the template and reloads NGINX. On error, the previous version is restored and the error is shown.
  • Impact: global; all sites inherit server-wide behavior defined here.

VirtualHost Template (standard domains)

  • Purpose: defines port bindings, server_name, roots, basic headers, and upstream/PHP handoff for non-cached sites.
  • Save Changes: updates the template for future domains.
  • Validate & Apply to all Domain accounts: regenerates vhosts for all existing domains using this template and reloads NGINX.
  • Progress: bulk apply streams live notifications (started, processing, completed, error) until finished.

Cache Template (proxy cache)

  • Purpose: same as the standard vhost, plus cache zones/keys, storage, revalidate rules, and cache-control handling.
  • When to use: static-heavy or upstream-backed sites that benefit from edge caching at NGINX.
  • Save vs Apply: matches the behavior of the standard vhost template (future domains vs all domains).

Proxy VirtualHost Template (reverse proxy)

  • Purpose: front-end reverse proxy directives (proxy_pass, headers, buffering, timeouts) for upstream apps or for Apache-behind-NGINX mode.
  • Save vs Apply: identical workflow; bulk apply re-renders all proxied domains.

Best practices

  • Keep global directives in nginx.conf; keep per-site rules in vhost templates.
  • Use variables/placeholders instead of hardcoding hostnames, ports, or absolute paths.
  • Validate syntax before bulk apply; test on one domain or a staging host.
  • Version control your templates externally for audit and rollback.

Troubleshooting

  • Page unavailable: install/enable NGINX or NGINX+Apache.
  • Validation failed: the system restores the previous template; fix the reported error and retry.
  • Bulk apply stopped: the stream shows the domain that failed; correct the template or that domain’s data and run again.
  • Unexpected behavior after apply: diff the generated vhost with your changes; revert using your saved template if needed.

Navigation