Skip to content

List of Supported Environment Variables

Mia Winter edited this page Feb 20, 2023 · 5 revisions

Proxied Containers

  • VIRTUAL_HOST - required - Must be defined by each container that nginx should proxy requests to.
  • VIRTUAL_PORT - optional - Should be defined by any proxied containers that expose more than one port. If only one port is exposed, or if multiple ports are exposed but one of them is port 80, then port 80 will be the default.
  • VIRTUAL_PROTO - optional - may contain one of the following values:
    • http (default) - To connect to a HTTP backend.
    • https - To connect to a HTTPS backend. See note in README.md.
    • uwsgi - To connect to a uWSGI backend.
    • fastcgi - To connect to a FastCGI backend.
  • NETWORK_ACCESS - optional - Value of "internal" means that only clients behind the proxy will be directed to the container. Value of "external" (default) means that clients outside of the proxy will also be directed to the container.
  • HTTPS_METHOD - optional
    • redirect (default) - Redirects HTTP requests to HTTPS via HSTS.
    • noredirect - Does not redirect HTTP requests to HTTPS.
    • nohttp - Disables the non-SSL site entirely. HTTP requests will get an error.
  • HSTS - optional - Configures HSTS settings.
    • max-age=31536000 (default)
    • off
    • More info in the README.md.
  • SSL_POLICY - optional - Defines the SSL policy to be applied.
    • Mozilla-Intermediate (default)
    • More info in the README.md.
  • VIRTUAL_ROOT - optional - When using FastCGI, define this value for your root directory.
  • CERT_NAME - optional - If your certificate(s) supports multiple domain names, use this variable to identify the certificate to be used. For example, a certificate for *.foo.com and *.bar.com could be named shared.crt and shared.key. A container running with VIRTUAL_HOST=foo.bar.com and CERT_NAME=shared will then use this shared cert.

Nginx Proxy Container

  • DEFAULT_HOST - optional - Should contain the name of the host that non-matching requests get proxied to.
  • ENABLE_IPV6 - optional - Enables IPv6 support. Defaults to true.
  • RESOLVERS - optional - List of DNS resolvers for nginx.
  • DISABLE_ACCESS_LOGS - optional - Disables the access logs of the Proxy Container (this does not affect other Container that are being proxied)