Module caddy

Caddy web server.

Loading the caddy module automatically exports /var/www to the docroot directory and /root to the home directory. The caddy object is also exposed under the name webserver.

Functions

AddWebsite (website) Add a new website to caddy server config.
website:AddRedirect (redirect) Add redirect rule to the website.
website:AddRewrite (rewrite) Add rewrite rule to the website.
website:AddProxy (proxy) Add proxy rule to the website.
website:AddWebsocket (websocket) Add websocket rule to the website.
AddFastCGI (fastcgiserver) Add a new FastCGI server caddy server config.

Tables

website Website configuration.
redirect Redirect configuration.
rewrite Rewrite rule.
proxy Proxy rule.
websocket Websocket application.
fastcgiserver FastCGI server.


Functions

AddWebsite (website) line 22
Add a new website to caddy server config.

Parameters:

  • website

Returns:

    website

See also:

Usage:

    local WebSite = caddy:AddWebsite{hostname='hostname', root='/path/to/docroot'}
website:AddRedirect (redirect) line 46
Add redirect rule to the website.

Parameters:

  • redirect

Returns:

    website

See also:

Usage:

    local WebSite = caddy:AddWebsite{hostname='hostname', root='/path/to/docroot'}
    WebSite:AddRedirect{source='/source', target='/target', status=status}
website:AddRewrite (rewrite) line 64
Add rewrite rule to the website.

Parameters:

  • rewrite

Returns:

    website

See also:

Usage:

    local WebSite = caddy:AddWebsite{hostname='hostname', root='/path/to/docroot'}
    WebSite:AddRewrite{source='/source', target='/target'}
website:AddProxy (proxy) line 83
Add proxy rule to the website.

Parameters:

  • proxy

Returns:

    website

See also:

Usage:

    local WebSite = caddy:AddWebsite{hostname='hostname', root='/path/to/docroot'}
    WebSite:AddProxy{source='/', target='127.0.0.1:8080'}
website:AddWebsocket (websocket) line 101
Add websocket rule to the website.

Parameters:

  • websocket

Returns:

    website

See also:

Usage:

    local WebSite = caddy:AddWebsite{hostname='hostname', root='/path/to/docroot'}
    WebSite:AddWebsocket{source='/cat', target='/bin/cat'}
AddFastCGI (fastcgiserver) line 120
Add a new FastCGI server caddy server config.

Parameters:

  • fastcgiserver

Returns:

    fastcgiserver

See also:

Tables

website line 17
Website configuration.

Fields:

  • hostname string Hostname of website.
  • port integer Port to listen on. (optional)
  • root string Path to document root. (optional)
redirect line 39
Redirect configuration.

Fields:

  • source string Source Path.
  • target string Target Path.
  • status int Status code to return. (optional)
rewrite line 57
Rewrite rule.

Fields:

  • source string Source Path.
  • target string Target Path.
proxy line 76
Proxy rule.

Fields:

  • source string Source Path.
  • target string Target to proxy to.
  • hostname [opt] string Host: header to send to server.
websocket line 94
Websocket application.

Fields:

  • source string Source Path.
  • target string Target application.
fastcgiserver line 116
FastCGI server.

Fields:

  • ext string Filename extension to match.
  • socket string Socket to connect to.
generated by LDoc 1.4.6 Last updated 2019-03-17 07:43:26