http

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalRoutePathPrefix = "/_ngf-internal"
	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
	Type            LocationType
	ProxySetHeaders []Header
	ProxySSLVerify  *ProxySSLVerify
	Return          *Return
	ResponseHeaders ResponseHeaders
	Rewrites        []string
	Includes        []shared.Include
	GRPC            bool
}

Location holds all configuration for an HTTP location.

type LocationType added in v1.4.0

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

type ProxySSLVerify added in v1.2.0

type ProxySSLVerify struct {
	TrustedCertificate string
	Name               string
}

ProxySSLVerify holds the proxied HTTPS server verification configuration.

type ResponseHeaders added in v1.3.0

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 added in v1.4.0

type ServerConfig struct {
	Servers         []Server
	RewriteClientIP shared.RewriteClientIPSettings
	IPFamily        shared.IPFamily
	Plus            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
	Servers  []UpstreamServer
}

Upstream holds all 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