New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nginx-server

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nginx-server

Utility for controlling an Nginx server

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

nginx-server

Utility for starting and stopping an Nginx server. Useful when testing an nginx configuration, having a start and stop for every test.

Example

var nginx = require('nginx-server');

var options = {
    config: __dirname + '/test/conf/nginx.conf',
};

var server = nginx(options);

server.start(function () {
    console.log('started');
});

server.stop(function () {
    console.log('stopped');
});

Options

config: string Path to configuration file.
prefix: string Set nginx path prefix, i.e. a directory that will keep server files.
globals: [string] String array of global configuration directives.
command: string Nginx executable (default: 'nginx').
log: function Pass in function for logging nginx output.

Development

Run tests

docker build -f docker/Dockerfile.test -t test-nginx-server .
docker run --rm -v $(pwd):/usr/src/app -it test-nginx-server

Debug output

For having debug output in the log, two things are required:

  • Have nginx configured to support debugging during the build: http://nginx.org/en/docs/debugging_log.html
  • Set environment variable LOG_LEVEL=TRACE.

Keywords

nginx

FAQs

Package last updated on 25 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts