nginx

package
v0.4.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(cfg *config.NginxConfig, deploymentsPath string, webrootPath string) *Manager

func (*Manager) ConfigPath

func (m *Manager) ConfigPath() string

func (*Manager) CreateMultiDomainVirtualHost added in v0.1.5

func (m *Manager) CreateMultiDomainVirtualHost(deployment *models.Deployment) error

func (*Manager) CreateVirtualHost

func (m *Manager) CreateVirtualHost(deployment *models.Deployment) error

func (*Manager) DeleteVirtualHost

func (m *Manager) DeleteVirtualHost(deploymentName string) error

func (*Manager) GetSecurityHookStatus added in v0.1.5

func (m *Manager) GetSecurityHookStatus(deploymentName string) (*SecurityHookStatus, error)

GetSecurityHookStatus returns detailed info about security hooks in a vhost

func (*Manager) GetVhostsUsingSSLDomain added in v0.1.5

func (m *Manager) GetVhostsUsingSSLDomain(domain string) []string

func (*Manager) GetVirtualHost

func (m *Manager) GetVirtualHost(deploymentName string) (string, error)

func (*Manager) ListVirtualHosts

func (m *Manager) ListVirtualHosts() ([]VirtualHostInfo, error)

func (*Manager) ProbeTarget

func (m *Manager) ProbeTarget(service string, port int) (listening bool, checked bool)

ProbeTarget checks, from inside the nginx container, whether service:port accepts a TCP connection, using the same name resolution the proxy itself uses. The second return value is false when the check could not be performed (no probe tool in the image, nginx container unavailable, unsupported flags), so callers can stay silent instead of reporting a false dead route.

func (*Manager) Reload

func (m *Manager) Reload() error

func (*Manager) RemoveDeploymentRateLimits added in v0.1.5

func (m *Manager) RemoveDeploymentRateLimits(deploymentName string) error

RemoveDeploymentRateLimits removes rate limit zones for a deployment

func (*Manager) RenderVirtualHost added in v0.3.0

func (m *Manager) RenderVirtualHost(deployment *models.Deployment) (string, error)

RenderVirtualHost returns the config that CreateVirtualHost would write, without touching disk or nginx.

func (*Manager) SetStaplingChecker

func (m *Manager) SetStaplingChecker(fn func(sslDomain string) bool)

SetStaplingChecker injects a predicate that reports whether ssl_stapling should be enabled for an SSL domain (true when its certificate advertises an OCSP responder). When left unset, stapling stays enabled, preserving prior behaviour.

func (*Manager) TestConfig

func (m *Manager) TestConfig() error

func (*Manager) UpdateConfig added in v0.1.5

func (m *Manager) UpdateConfig(cfg *config.NginxConfig, deploymentsPath string, webrootPath string)

func (*Manager) UpdateDeploymentRateLimits added in v0.1.5

func (m *Manager) UpdateDeploymentRateLimits(deploymentName string, rateLimits []models.DeploymentRateLimit) error

UpdateDeploymentRateLimits writes per-deployment rate limit zones to rate_limits.conf

func (*Manager) UpdateVirtualHost

func (m *Manager) UpdateVirtualHost(deployment *models.Deployment) error

func (*Manager) ValidateSecurityHooks added in v0.1.5

func (m *Manager) ValidateSecurityHooks(deploymentName string, shouldHaveHooks bool) error

ValidateSecurityHooks checks that a vhost has the correct security hooks based on the expected state

func (*Manager) VirtualHostExists

func (m *Manager) VirtualHostExists(deploymentName string) bool

func (*Manager) WriteVirtualHost added in v0.1.5

func (m *Manager) WriteVirtualHost(deploymentName string, content string) error

type SecurityHookStatus added in v0.1.5

type SecurityHookStatus struct {
	HasHooks           bool     `json:"has_hooks"`
	HookLocations      []string `json:"hook_locations"`
	ProperlyConfigured bool     `json:"properly_configured"`
}

SecurityHookStatus returns details about security hooks in a vhost

type VirtualHostInfo

type VirtualHostInfo struct {
	Name       string `json:"name"`
	ConfigFile string `json:"config_file"`
	ModifiedAt int64  `json:"modified_at"`
}

Jump to

Keyboard shortcuts

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