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

nginx-dist

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nginx-dist

Use [nginx](http://nginx.org) as an npm module for tighter integration with node apps (e.g. test fixtures).

latest
Source
npmnpm
Version
1.25.4-7
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

nginx-dist

Use nginx as an npm module for tighter integration with node apps (e.g. test fixtures).

Build steps based on https://github.com/jirutka/nginx-binaries with some modifications (remove some modules and add in http3 support with libressl)

Usage

npm install nginx-dist

Example config, put in nginx.conf:

error_log stderr;
daemon off;
events {}
http {
  # Respond to health checks
  server {
    listen unix:./nginx.sock;
    location / {
      echo "OK";
    }
  }
  access_log off;
  server {
    listen 8080;
    root .;
  }
}
import nginx from "nginx-dist";

const server = await nginx();
server.stop();

Running on privileged ports

If you want to bind to privileged ports (anything below 1024, like 80 for http och 443 for https) you need to set the capabilities for the binary.

Something like this should work:

sudo setcap 'cap_net_bind_service=+ep' ./node_modules/nginx-dist-*/nginx

FAQs

Package last updated on 24 Feb 2024

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