(?string)
Name or path of the nginx binary to start. Defaults to 'nginx'
.
This option is ignored if version
is provided.
(?string)
A SemVer version range specifying the nginx version to run.
Nginx binary for your OS and architecture will be downloaded from nginx-binaries. It will be stored in directory .cache/nginx-binaries/
inside the nearest writeable node_modules
directory or in nginx-binaries/
inside the system-preferred temp directory.
Not all versions are available. You can find a list of available binaries at nginx-binaries.
(?string)
Nginx configuration to use.
If configPath
is provided, the processed config will be written to a temporary file .<filename>~
(where <filename>
is a filename from configPath
) in the configPath
’s directory (e.g. conf/nginx.conf
→ conf/.nginx.conf~
). Otherwise it will be written into nginx.conf
file in workDir
. In either case, this file will be automatically deleted after stopping the nginx.
The config may include the following placeholders which will be replaced with corresponding values:
__ADDRESS__
— The address as specified in bindAddress
.
__CONFDIR__
— Path to directory with the config file as specified in configPath
.
__CWD__
— The current working directory as reported by process.cwd()
.
__WORKDIR__
— Path to the nginx’s working directory as specified in workDir
.
__PORT__
, __PORT_1__
, …, __PORT_9__
— The port numbers as specified in ports
and preferredPorts
.
It will be modified for compatibility with the runner by applying patch operations specified in configPatch
variable.
Either configPath
, or config
must be provided!
(?string)
Path of the nginx configuration file to use.
This file will be processed and the resulting config file will be written to a temporary file .<filename>~
(where <filename>
is a filename from configPath
) in the configPath
’s directory (e.g. conf/nginx.conf
→ conf/.nginx.conf~
). This temporary file will be automatically deleted after stopping the nginx.
See config
option for information about placeholders and patching.
Either configPath
, or config
must be provided!
(?string)
Hostname or IP address the port(s) will be binding on. This is used when searching for free ports (see preferredPorts
) and for substituting __ADDRESS__
placeholder in the given nginx config. Defaults to '127.0.0.1'
.
(?number[])
A list of port numbers for substituting __PORT__
, __PORT_1__
, …, __PORT_9__
placeholders in the given nginx config. Unlike preferredPorts
, these are not checked for availability and nginx will fail to start if any of the provided and used ports is unavailable.
If it’s not provided or more ports are needed, next ports are selected from the preferredPorts
or randomly.
(?number[])
A list of preferred port numbers to use for substituting __PORT__
, __PORT_1__
, …, __PORT_9__
placeholders in the given nginx config.
Unavailable ports (used by some other program or restricted by OS) are skipped. If there are no preferred ports left and another port is needed, a random port number is used.
(?string)
Path of a directory that will be passed as a prefix (-p
) into nginx
. It will be automatically created if doesn’t exist.
If not provided, an unique temporary directory will be created: .cache/nginx-testing-XXXXXX/
relative to the nearest writable node_modules
(nearest to process.cwd()
) or nginx-testing-XXXXXX/
in the system-preferred temp directory. The created directory will be automatically deleted after stopping.
(?string | ?stream.Writable)
One of:
'buffer'
— Collect the nginx’s stderr to a buffer that can be read using readErrorLog()
(default).
'ignore'
— Ignore nginx’s stderr.
'inherit'
— Pass through the nginx’s stderr output to the Node process.
<stream.Writable>
— A writable stream to pipe the nginx’s stderr to.
Nginx error log is expected to be redirected to stderr. Directive error_log stderr info;
will be automatically added to the config, unless there’s already error_log
defined in the main context.
(?string | ?stream.Writable)
One of:
'buffer'
— Collect the nginx’s access log to a buffer that can be read using readAccessLog()
(default).
'ignore'
— Ignore nginx’s access log.
<stream.Writable>
— A writable stream to pipe the nginx’s access log to.
Nginx access log is expected to be redirected to file <workDir>/access.log
. Directive access_log access.log;
will be automatically added to the config, unless there’s already access_log
defined in the http
context.
(?number)
Number of milliseconds after the start to wait for the nginx to respond to the health-check request (HEAD http://<bindAddress>:<ports[0]>/health
). Any HTTP status is considered as success — it just checks if the nginx is listening and responding.
Defaults to 1000
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4