Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Distribution ¶
Distribution maps weight to a value in a SplitClient.
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 InternalRedirectLocation ¶
InternalRedirectLocation defines a location for internally redirecting requests to named locations.
type Location ¶
type Location struct {
Path string
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
HasKeepalive bool
DefaultType string
Return *Return
}
Location defines a location.
type Return ¶ added in v1.6.0
Return defines a Return directive used for redirects and canned responses.
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
HealthChecks []HealthCheck
TLSRedirect *TLSRedirect
}
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 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) (*TemplateExecutor, error)
NewTemplateExecutor creates a TemplateExecutor.
func (*TemplateExecutor) ExecuteVirtualServerTemplate ¶
func (te *TemplateExecutor) ExecuteVirtualServerTemplate(cfg *VirtualServerConfig) ([]byte, error)
ExecuteVirtualServerTemplate generates the content of an NGINX configuration file for a VirtualServer resource.
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
}
Upstream defines an upstream.
type UpstreamServer ¶
type UpstreamServer struct {
Address string
}
UpstreamServer defines an upstream server.
type VirtualServerConfig ¶
type VirtualServerConfig struct {
Server Server
Upstreams []Upstream
SplitClients []SplitClient
Maps []Map
StatusMatches []StatusMatch
}
VirtualServerConfig holds NGINX configuration for a VirtualServer.