http

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalRoutePathPrefix       = "/_ngf-internal"
	InternalMirrorRoutePathPrefix = InternalRoutePathPrefix + "-mirror"
	HTTPSScheme                   = "https"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Name  string
	Value string
}

Header defines an HTTP header to be passed to the proxied server.

type Location

type Location struct {
	Path                           string
	ProxyPass                      string
	HTTPMatchKey                   string
	MirrorSplitClientsVariableName string
	Type                           LocationType
	ProxySetHeaders                []Header
	ProxySSLVerify                 *ProxySSLVerify
	Return                         *Return
	ResponseHeaders                ResponseHeaders
	Rewrites                       []string
	MirrorPaths                    []string
	Includes                       []shared.Include
	GRPC                           bool
}

Location holds all configuration for an HTTP location.

type LocationType

type LocationType string
const (
	InternalLocationType LocationType = "internal"
	ExternalLocationType LocationType = "external"
	RedirectLocationType LocationType = "redirect"
)

type ProxySSLVerify

type ProxySSLVerify struct {
	TrustedCertificate string
	Name               string
}

ProxySSLVerify holds the proxied HTTPS server verification configuration.

type ResponseHeaders

type ResponseHeaders struct {
	Add    []Header
	Set    []Header
	Remove []string
}

ResponseHeaders holds all response headers to be added, set, or removed.

type Return

type Return struct {
	Body string
	Code StatusCode
}

Return represents an HTTP return.

type SSL

type SSL struct {
	Certificate    string
	CertificateKey string
}

SSL holds all SSL related configuration.

type Server

type Server struct {
	SSL           *SSL
	ServerName    string
	Listen        string
	Locations     []Location
	Includes      []shared.Include
	IsDefaultHTTP bool
	IsDefaultSSL  bool
	GRPC          bool
	IsSocket      bool
}

Server holds all configuration for an HTTP server.

type ServerConfig

type ServerConfig struct {
	Servers                  []Server
	RewriteClientIP          shared.RewriteClientIPSettings
	IPFamily                 shared.IPFamily
	Plus                     bool
	DisableSNIHostValidation bool
}

ServerConfig holds configuration for an HTTP server and IP family to be used by NGINX.

type SplitClient

type SplitClient struct {
	VariableName  string
	Distributions []SplitClientDistribution
}

SplitClient holds all configuration for an HTTP split client.

type SplitClientDistribution

type SplitClientDistribution struct {
	Percent string
	Value   string
}

SplitClientDistribution maps Percentage to Value in a SplitClient.

type StatusCode

type StatusCode int

StatusCode is an HTTP status code.

const (
	// StatusFound is the HTTP 302 status code.
	StatusFound StatusCode = 302
	// StatusNotFound is the HTTP 404 status code.
	StatusNotFound StatusCode = 404
	// StatusInternalServerError is the HTTP 500 status code.
	StatusInternalServerError StatusCode = 500
)

type Upstream

type Upstream struct {
	Name      string
	ZoneSize  string // format: 512k, 1m
	StateFile string
	KeepAlive UpstreamKeepAlive
	Servers   []UpstreamServer
}

Upstream holds all configuration for an HTTP upstream.

type UpstreamKeepAlive

type UpstreamKeepAlive struct {
	Time        string
	Timeout     string
	Connections int32
	Requests    int32
}

UpstreamKeepAlive holds the keepalive configuration for an HTTP upstream.

type UpstreamServer

type UpstreamServer struct {
	Address string
}

UpstreamServer holds all configuration for an HTTP upstream server.

Jump to

Keyboard shortcuts

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