Documentation
      ¶
    
    
  
    
  
    Index ¶
- type AddHeader
 - type Distribution
 - type EgressMTLS
 - type ErrorPage
 - type ErrorPageLocation
 - type Header
 - type HealthCheck
 - type IngressMTLS
 - type InternalRedirectLocation
 - type JWTAuth
 - type LimitReq
 - type LimitReqOptions
 - type LimitReqZone
 - type Location
 - type Map
 - type OIDC
 - type Parameter
 - type Queue
 - type Return
 - type ReturnLocation
 - type SSL
 - type Server
 - type SessionCookie
 - type SplitClient
 - type StatusMatch
 - type StreamHealthCheck
 - type StreamServer
 - type StreamUpstream
 - type StreamUpstreamServer
 - type TLSPassthroughHostsConfig
 - type TLSRedirect
 - type TemplateExecutor
 - func (te *TemplateExecutor) ExecuteTLSPassthroughHostsTemplate(cfg *TLSPassthroughHostsConfig) ([]byte, error)
 - func (te *TemplateExecutor) ExecuteTransportServerTemplate(cfg *TransportServerConfig) ([]byte, error)
 - func (te *TemplateExecutor) ExecuteVirtualServerTemplate(cfg *VirtualServerConfig) ([]byte, error)
 - func (te *TemplateExecutor) UpdateVirtualServerTemplate(templateString *string) error
 
- type TransportServerConfig
 - type Upstream
 - type UpstreamLabels
 - type UpstreamServer
 - type VirtualServerConfig
 - type WAF
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddHeader ¶ added in v1.8.0
AddHeader defines a header to use with add_header directive with an optional Always field.
type Distribution ¶
Distribution maps weight to a value in a SplitClient.
type EgressMTLS ¶ added in v1.9.0
type EgressMTLS struct {
	Certificate    string
	CertificateKey string
	VerifyServer   bool
	VerifyDepth    int
	Ciphers        string
	Protocols      string
	TrustedCert    string
	SessionReuse   bool
	ServerName     bool
	SSLName        string
}
    EgressMTLS defines TLS configuration for a location.
type ErrorPageLocation ¶ added in v1.7.0
ErrorPageLocation defines a named location for an error_page directive.
type HealthCheck ¶ added in v1.6.0
type HealthCheck struct {
	Name                string
	URI                 string
	Interval            string
	Jitter              string
	Fails               int
	Passes              int
	Port                int
	ProxyPass           string
	ProxyConnectTimeout string
	ProxyReadTimeout    string
	ProxySendTimeout    string
	Headers             map[string]string
	Match               string
}
    HealthCheck defines a HealthCheck for an upstream in a Server.
type IngressMTLS ¶ added in v1.9.0
IngressMTLS defines TLS configuration for a server. This is a subset of TLS specifically for clients auth.
type InternalRedirectLocation ¶
InternalRedirectLocation defines a location for internally redirecting requests to named locations.
type LimitReqOptions ¶ added in v1.9.0
LimitReqOptions defines rate limit options.
func (LimitReqOptions) String ¶ added in v1.9.0
func (rl LimitReqOptions) String() string
type LimitReqZone ¶ added in v1.9.0
LimitReqZone defines a rate limit shared memory zone.
func (LimitReqZone) String ¶ added in v1.9.0
func (rlz LimitReqZone) String() string
type Location ¶
type Location struct {
	Path                     string
	Internal                 bool
	Snippets                 []string
	ProxyConnectTimeout      string
	ProxyReadTimeout         string
	ProxySendTimeout         string
	ClientMaxBodySize        string
	ProxyMaxTempFileSize     string
	ProxyBuffering           bool
	ProxyBuffers             string
	ProxyBufferSize          string
	ProxyPass                string
	ProxyNextUpstream        string
	ProxyNextUpstreamTimeout string
	ProxyNextUpstreamTries   int
	ProxyInterceptErrors     bool
	ProxyPassRequestHeaders  bool
	ProxySetHeaders          []Header
	ProxyHideHeaders         []string
	ProxyPassHeaders         []string
	ProxyIgnoreHeaders       string
	ProxyPassRewrite         string
	AddHeaders               []AddHeader
	Rewrites                 []string
	HasKeepalive             bool
	ErrorPages               []ErrorPage
	ProxySSLName             string
	InternalProxyPass        string
	Allow                    []string
	Deny                     []string
	LimitReqOptions          LimitReqOptions
	LimitReqs                []LimitReq
	JWTAuth                  *JWTAuth
	EgressMTLS               *EgressMTLS
	OIDC                     bool
	WAF                      *WAF
	PoliciesErrorReturn      *Return
	ServiceName              string
	IsVSR                    bool
	VSRName                  string
	VSRNamespace             string
}
    Location defines a location.
type Return ¶ added in v1.6.0
Return defines a Return directive used for redirects and canned responses.
type ReturnLocation ¶ added in v1.8.0
ReturnLocation defines a location for returning a fixed response.
type Server ¶
type Server struct {
	ServerName                string
	StatusZone                string
	ProxyProtocol             bool
	SSL                       *SSL
	ServerTokens              string
	RealIPHeader              string
	SetRealIPFrom             []string
	RealIPRecursive           bool
	Snippets                  []string
	InternalRedirectLocations []InternalRedirectLocation
	Locations                 []Location
	ErrorPageLocations        []ErrorPageLocation
	ReturnLocations           []ReturnLocation
	HealthChecks              []HealthCheck
	TLSRedirect               *TLSRedirect
	TLSPassthrough            bool
	Allow                     []string
	Deny                      []string
	LimitReqOptions           LimitReqOptions
	LimitReqs                 []LimitReq
	JWTAuth                   *JWTAuth
	IngressMTLS               *IngressMTLS
	EgressMTLS                *EgressMTLS
	OIDC                      *OIDC
	WAF                       *WAF
	PoliciesErrorReturn       *Return
	VSNamespace               string
	VSName                    string
}
    Server defines a server.
type SessionCookie ¶ added in v1.6.0
type SessionCookie struct {
	Enable   bool
	Name     string
	Path     string
	Expires  string
	Domain   string
	HTTPOnly bool
	Secure   bool
}
    SessionCookie defines a session cookie for an upstream.
type SplitClient ¶
type SplitClient struct {
	Source        string
	Variable      string
	Distributions []Distribution
}
    SplitClient defines a split_clients.
type StatusMatch ¶ added in v1.6.0
StatusMatch defines a Match block for status codes.
type StreamHealthCheck ¶ added in v1.11.0
type StreamHealthCheck struct {
	Enabled  bool
	Interval string
	Port     int
	Passes   int
	Jitter   string
	Fails    int
	Timeout  string
}
    StreamHealthCheck defines a health check for a StreamUpstream in a StreamServer.
type StreamServer ¶ added in v1.7.0
type StreamServer struct {
	TLSPassthrough           bool
	UnixSocket               string
	Port                     int
	UDP                      bool
	StatusZone               string
	ProxyRequests            *int
	ProxyResponses           *int
	ProxyPass                string
	Name                     string
	Namespace                string
	ProxyTimeout             string
	ProxyConnectTimeout      string
	ProxyNextUpstream        bool
	ProxyNextUpstreamTimeout string
	ProxyNextUpstreamTries   int
	HealthCheck              *StreamHealthCheck
	Snippets                 []string
}
    StreamServer defines a server in the stream module.
type StreamUpstream ¶ added in v1.7.0
type StreamUpstream struct {
	Name           string
	Servers        []StreamUpstreamServer
	UpstreamLabels UpstreamLabels
}
    StreamUpstream defines a stream upstream.
type StreamUpstreamServer ¶ added in v1.7.0
StreamUpstreamServer defines a stream upstream server.
type TLSPassthroughHostsConfig ¶ added in v1.7.0
TLSPassthroughHostsConfig defines a mapping between TLS Passthrough hosts and the corresponding unix sockets.
type TLSRedirect ¶ added in v1.6.0
TLSRedirect defines a redirect in a Server.
type TemplateExecutor ¶
type TemplateExecutor struct {
	// contains filtered or unexported fields
}
    TemplateExecutor executes NGINX configuration templates.
func NewTemplateExecutor ¶
func NewTemplateExecutor(virtualServerTemplatePath string, transportServerTemplatePath string) (*TemplateExecutor, error)
NewTemplateExecutor creates a TemplateExecutor.
func (*TemplateExecutor) ExecuteTLSPassthroughHostsTemplate ¶ added in v1.7.0
func (te *TemplateExecutor) ExecuteTLSPassthroughHostsTemplate(cfg *TLSPassthroughHostsConfig) ([]byte, error)
ExecuteTLSPassthroughHostsTemplate generates the content of an NGINX configuration file for mapping between TLS Passthrough hosts and the corresponding unix sockets.
func (*TemplateExecutor) ExecuteTransportServerTemplate ¶ added in v1.7.0
func (te *TemplateExecutor) ExecuteTransportServerTemplate(cfg *TransportServerConfig) ([]byte, error)
ExecuteTransportServerTemplate generates the content of an NGINX configuration file for a TransportServer resource.
func (*TemplateExecutor) ExecuteVirtualServerTemplate ¶
func (te *TemplateExecutor) ExecuteVirtualServerTemplate(cfg *VirtualServerConfig) ([]byte, error)
ExecuteVirtualServerTemplate generates the content of an NGINX configuration file for a VirtualServer resource.
func (*TemplateExecutor) UpdateVirtualServerTemplate ¶ added in v1.8.0
func (te *TemplateExecutor) UpdateVirtualServerTemplate(templateString *string) error
UpdateVirtualServerTemplate updates the VirtualServer template.
type TransportServerConfig ¶ added in v1.7.0
type TransportServerConfig struct {
	Server    StreamServer
	Upstreams []StreamUpstream
}
    TransportServerConfig holds NGINX configuration for a TransportServer.
type Upstream ¶
type Upstream struct {
	Name             string
	Servers          []UpstreamServer
	LBMethod         string
	Resolve          bool
	Keepalive        int
	MaxFails         int
	MaxConns         int
	SlowStart        string
	FailTimeout      string
	UpstreamZoneSize string
	Queue            *Queue
	SessionCookie    *SessionCookie
	UpstreamLabels   UpstreamLabels
}
    Upstream defines an upstream.
type UpstreamLabels ¶ added in v1.9.0
type UpstreamLabels struct {
	Service           string
	ResourceType      string
	ResourceName      string
	ResourceNamespace string
}
    UpstreamLabels describes the Prometheus labels for an NGINX upstream.
type UpstreamServer ¶
type UpstreamServer struct {
	Address string
}
    UpstreamServer defines an upstream server.
type VirtualServerConfig ¶
type VirtualServerConfig struct {
	HTTPSnippets  []string
	LimitReqZones []LimitReqZone
	Maps          []Map
	Server        Server
	SpiffeCerts   bool
	SplitClients  []SplitClient
	StatusMatches []StatusMatch
	Upstreams     []Upstream
}
    VirtualServerConfig holds NGINX configuration for a VirtualServer.