proxy_nginx

package
v1.3.1-0...-3e602c1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

README

Nginx proxy module

Unmaintained

About this module

This module sets up a Nginx webserver on the target server, which will then be used to accept web requests and forward/proxy it to the container of the actual application behind the domain.

There also is a logic for certificate generation via Certbot.

Installation

Running stackhead setup with this module enabled will install:

  • Nginx
  • Certbot

Configuration

The following settings are available in CLI config:

modules_config:
  nginx:
    certificates_email: "certificates@saitho.me" # mail address used for certificate renewals
    config:
      User: "www-data"
      ConfPath  : "/etc/nginx/conf.d"
      VhostPath: "/etc/nginx/sites-enabled"
      ErrorLog  : "/var/log/nginx/error.log"
      AccessLog: "/var/log/nginx/access.log"
      PidFile   : "/run/nginx.pid"
      WorkerProcesses: "auto"
      ExtraConfOptions: # additional settings for nginx.conf
        foo: bar
      ExtraConfHttpOptions: # additional settings for nginx.conf inside http block
        foo: bar
      WorkerConnections: 1024
      MultiAccept: off
      MimeFilePath: /etc/nginx/mime.types
      ServerNamesHashBucketSize: 64
      ClientMaxBodySize: "64m"
      Sendfile: "on"
      TcpNopush: "on"
      TcpNodelay: "on"
      ServerTokens: "on"
      ProxyCachePath: ""
      KeepaliveTimeout: 65
      KeepaliveRequests: 100
      TypesHashMaxSize: 2048

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcmeChallengesDirectory = config.RootDirectory + "/acme-challenges"
View Source
var CertificatesDirectory = config.RootDirectory + "/certificates"

Functions

func GetCertificateDirectoryPath

func GetCertificateDirectoryPath(p *project.Project) string

func GetCertificatesDirectory

func GetCertificatesDirectory(p *project.Project) string

func GetSnakeoilPaths

func GetSnakeoilPaths() (string, string)

Types

type Module

type Module struct {
}

func (Module) Deploy

func (Module) Deploy(_modulesSettings interface{}) error

func (Module) Destroy

func (m Module) Destroy(_modulesSettings interface{}) error

func (Module) GetConfig

func (Module) GetConfig() system.ModuleConfig

func (Module) GetTemplates

func (Module) GetTemplates() *embed.FS

func (Module) Init

func (Module) Init(moduleSettings interface{})

func (Module) Install

func (Module) Install(_modulesSettings interface{}) error

type ModuleSettings

type ModuleSettings struct {
	CertificatesEmail string
	Config            NginxConfig
}

type NginxConfig

type NginxConfig struct {
	User                      string
	ConfPath                  string
	VhostPath                 string
	ErrorLog                  string
	AccessLog                 string
	PidFile                   string
	WorkerProcesses           string
	ExtraConfOptions          map[string]string
	ExtraConfHttpOptions      map[string]string
	WorkerConnections         int
	MultiAccept               string
	MimeFilePath              string
	ServerNamesHashBucketSize int
	ClientMaxBodySize         string
	Sendfile                  string
	TcpNopush                 string
	TcpNodelay                string
	ServerTokens              string
	ProxyCachePath            string
	KeepaliveTimeout          int
	KeepaliveRequests         int
	TypesHashMaxSize          int
}

func (*NginxConfig) SetDefaults

func (c *NginxConfig) SetDefaults()

type Options

type Options struct {
	NginxUseHttps bool
}

type Paths

type Paths struct {
	RootDirectory                string
	CertificatesProjectDirectory string
	ProjectCertificatesDirectory string
	ProjectsRootDirectory        string
	AcmeChallengesDirectory      string
	SnakeoilFullchainPath        string
	SnakeoilPrivkeyPath          string
}

Jump to

Keyboard shortcuts

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