Custom nginx template

NGINX模板位于 /etc/nginx/template/nginx.tmpl文件中.

使用 Volumearrow-up-right 讲自定义模板变为可能. 这包括使用 Configmaparrow-up-right 作为模板的源文件

        volumeMounts:
          - mountPath: /etc/nginx/template
            name: nginx-template-volume
            readOnly: true
      volumes:
        - name: nginx-template-volume
          configMap:
            name: nginx-template
            items:
            - key: nginx.tmpl
              path: nginx.tmpl

请注意,模板已绑定到Go代码。 不要在变量中更改名称 $cfg.

有关模板语法的更多信息,请检查 Go template packagearrow-up-right. 除了Go软件包提供的内置功能之外,还可以使用以下功能:

TODO:

  • buildAuthLocation:

  • buildAuthResponseHeaders:

  • buildResolvers:

  • buildDenyVariable:

  • buildUpstreamName:

  • buildForwardedFor:

  • buildAuthSignURL:

  • buildNextUpstream:

  • filterRateLimits:

  • formatIP:

  • getenv:

  • getIngressInformation:

  • serverConfig:

  • isLocationAllowed:

  • isValidClientBodyBufferSize:

Last updated

Was this helpful?