version2

package
v3.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddHeader

type AddHeader struct {
	Header
	Always bool
}

AddHeader defines a header to use with add_header directive with an optional Always field.

type BasicAuth

type BasicAuth struct {
	Secret string
	Realm  string
}

BasicAuth refers to basic HTTP authentication mechanism options

type Distribution

type Distribution struct {
	Weight string
	Value  string
}

Distribution maps weight to a value in a SplitClient.

type Dos

type Dos struct {
	Enable                 string
	Name                   string
	ApDosPolicy            string
	ApDosSecurityLogEnable bool
	ApDosLogConf           string
	ApDosMonitorURI        string
	ApDosMonitorProtocol   string
	ApDosMonitorTimeout    uint64
	ApDosAccessLogDest     string
}

Dos defines Dos configuration.

type EgressMTLS

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 ErrorPage

type ErrorPage struct {
	Name         string
	Codes        string
	ResponseCode int
}

ErrorPage defines an error_page of a location.

type ErrorPageLocation

type ErrorPageLocation struct {
	Name        string
	DefaultType string
	Return      *Return
	Headers     []Header
}

ErrorPageLocation defines a named location for an error_page directive.

type Header struct {
	Name  string
	Value string
}

Header defines a header to use with add_header directive.

type HealthCheck

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
	GRPCPass            string
	GRPCStatus          *int
	GRPCService         string
	Mandatory           bool
	Persistent          bool
	KeepaliveTime       string
}

HealthCheck defines a HealthCheck for an upstream in a Server.

type IngressMTLS

type IngressMTLS struct {
	ClientCert   string
	ClientCrl    string
	VerifyClient string
	VerifyDepth  int
}

IngressMTLS defines TLS configuration for a server. This is a subset of TLS specifically for clients auth.

type InternalRedirectLocation

type InternalRedirectLocation struct {
	Path        string
	Destination string
}

InternalRedirectLocation defines a location for internally redirecting requests to named locations.

type JWTAuth

type JWTAuth struct {
	Key      string
	Secret   string
	Realm    string
	Token    string
	KeyCache string
	JwksURI  JwksURI
}

JWTAuth holds JWT authentication configuration.

type JwksURI

type JwksURI struct {
	JwksScheme string
	JwksHost   string
	JwksPort   string
	JwksPath   string
}

JwksURI defines the components of a JwksURI

type LimitReq

type LimitReq struct {
	ZoneName string
	Burst    int
	NoDelay  bool
	Delay    int
}

LimitReq defines a rate limit.

func (LimitReq) String

func (rl LimitReq) String() string

type LimitReqOptions

type LimitReqOptions struct {
	DryRun     bool
	LogLevel   string
	RejectCode int
}

LimitReqOptions defines rate limit options.

func (LimitReqOptions) String

func (rl LimitReqOptions) String() string

type LimitReqZone

type LimitReqZone struct {
	Key      string
	ZoneName string
	ZoneSize string
	Rate     string
}

LimitReqZone defines a rate limit shared memory zone.

func (LimitReqZone) String

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
	BasicAuth                *BasicAuth
	EgressMTLS               *EgressMTLS
	OIDC                     bool
	WAF                      *WAF
	Dos                      *Dos
	PoliciesErrorReturn      *Return
	ServiceName              string
	IsVSR                    bool
	VSRName                  string
	VSRNamespace             string
	GRPCPass                 string
}

Location defines a location.

type Map

type Map struct {
	Source     string
	Variable   string
	Parameters []Parameter
}

Map defines a map.

type Match

type Match struct {
	Name                string
	Send                string
	ExpectRegexModifier string
	Expect              string
}

Match defines a match block for a health check

type OIDC

type OIDC struct {
	AuthEndpoint      string
	ClientID          string
	ClientSecret      string
	JwksURI           string
	Scope             string
	TokenEndpoint     string
	RedirectURI       string
	ZoneSyncLeeway    int
	AuthExtraArgs     string
	AccessTokenEnable bool
}

OIDC holds OIDC configuration data.

type Parameter

type Parameter struct {
	Value  string
	Result string
}

Parameter defines a Parameter in a Map.

type Queue

type Queue struct {
	Size    int
	Timeout string
}

Queue defines a queue in upstream.

type Return

type Return struct {
	Code int
	Text string
}

Return defines a Return directive used for redirects and canned responses.

type ReturnLocation

type ReturnLocation struct {
	Name        string
	DefaultType string
	Return      Return
}

ReturnLocation defines a location for returning a fixed response.

type SSL

type SSL struct {
	HTTP2           bool
	Certificate     string
	CertificateKey  string
	RejectHandshake bool
}

SSL defines SSL configuration for a server.

type Server

type Server struct {
	ServerName                string
	StatusZone                string
	CustomListeners           bool
	HTTPPort                  int
	HTTPSPort                 int
	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
	JWTAuthList               map[string]*JWTAuth
	JWKSAuthEnabled           bool
	BasicAuth                 *BasicAuth
	IngressMTLS               *IngressMTLS
	EgressMTLS                *EgressMTLS
	OIDC                      *OIDC
	WAF                       *WAF
	Dos                       *Dos
	PoliciesErrorReturn       *Return
	VSNamespace               string
	VSName                    string
	DisableIPV6               bool
	Gunzip                    bool
}

Server defines a server.

type SessionCookie

type SessionCookie struct {
	Enable   bool
	Name     string
	Path     string
	Expires  string
	Domain   string
	HTTPOnly bool
	Secure   bool
	SameSite string
}

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

type StatusMatch struct {
	Name string
	Code string
}

StatusMatch defines a Match block for status codes.

type StreamHealthCheck

type StreamHealthCheck struct {
	Enabled  bool
	Interval string
	Port     int
	Passes   int
	Jitter   string
	Fails    int
	Timeout  string
	Match    string
}

StreamHealthCheck defines a health check for a StreamUpstream in a StreamServer.

type StreamSSL

type StreamSSL struct {
	Enabled        bool
	Certificate    string
	CertificateKey string
}

StreamSSL defines SSL configuration for a server.

type StreamServer

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
	ServerSnippets           []string
	DisableIPV6              bool
	SSL                      *StreamSSL
}

StreamServer defines a server in the stream module.

type StreamUpstream

type StreamUpstream struct {
	Name                string
	Servers             []StreamUpstreamServer
	UpstreamLabels      UpstreamLabels
	LoadBalancingMethod string
	Resolve             bool
	BackupServers       []StreamUpstreamBackupServer
}

StreamUpstream defines a stream upstream.

type StreamUpstreamBackupServer

type StreamUpstreamBackupServer struct {
	Address string
}

StreamUpstreamBackupServer represents Backup Server address or name defined by the ExternalName service.

type StreamUpstreamServer

type StreamUpstreamServer struct {
	Address        string
	MaxFails       int
	FailTimeout    string
	MaxConnections int
}

StreamUpstreamServer defines a stream upstream server.

type TLSPassthroughHostsConfig

type TLSPassthroughHostsConfig map[string]string

TLSPassthroughHostsConfig defines a mapping between TLS Passthrough hosts and the corresponding unix sockets.

type TLSRedirect

type TLSRedirect struct {
	Code    int
	BasedOn string
}

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

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

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

func (te *TemplateExecutor) UpdateVirtualServerTemplate(templateString *string) error

UpdateVirtualServerTemplate updates the VirtualServer template.

type TransportServerConfig

type TransportServerConfig struct {
	Server                  StreamServer
	Upstreams               []StreamUpstream
	StreamSnippets          []string
	Match                   *Match
	DisableIPV6             bool
	DynamicSSLReloadEnabled bool
	StaticSSLPath           string
}

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
	NTLM             bool
	BackupServers    []UpstreamServer
}

Upstream defines an upstream.

type UpstreamLabels

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
	SpiffeClientCerts       bool
	SplitClients            []SplitClient
	StatusMatches           []StatusMatch
	Upstreams               []Upstream
	DynamicSSLReloadEnabled bool
	StaticSSLPath           string
}

VirtualServerConfig holds NGINX configuration for a VirtualServer.

type WAF

type WAF struct {
	Enable              string
	ApPolicy            string
	ApBundle            string
	ApSecurityLogEnable bool
	ApLogConf           []string
}

WAF defines WAF configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL