Module nginx

Nignx web server.

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

Functions

AddWebsite (website) Add a new website to nginx 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.

Tables

website Website configuration.
redirect Redirect configuration.
rewrite Rewrite rule.
proxy Proxy rule.


Functions

AddWebsite (website) line 20
Add a new website to nginx server config.

Parameters:

  • website

Returns:

    website

See also:

Usage:

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

Parameters:

  • redirect

Returns:

    website

See also:

Usage:

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

Parameters:

  • rewrite

Returns:

    website

See also:

Usage:

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

Parameters:

  • proxy

Returns:

    website

See also:

Usage:

    local WebSite = nginx:AddWebsite{hostname='hostname', root='/path/to/docroot'}
    WebSite:AddProxy{source='/', target='127.0.0.1:8080'}

Tables

website line 15
Website configuration.

Fields:

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

Fields:

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

Fields:

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

Fields:

  • source string Source Path.
  • target string Target to proxy to.
  • hostname string Rewirte Host: header. (optional)
generated by LDoc 1.4.6 Last updated 2019-03-17 07:43:26