# add-nginx-ssl

> Add SSL config to nginx

Latest version **1.2.10** (published 2018-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install add-nginx-ssl
pnpm add add-nginx-ssl
yarn add add-nginx-ssl
bun add add-nginx-ssl
```

Provides the command `add-nginx-ssl`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.10 |
| Published | 2018-01-05 |
| First published | 2017-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 65 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/add-nginx-ssl
- Repository: https://github.com/mafintosh/add-nginx-ssl
- Issues: https://github.com/mafintosh/add-nginx-ssl/issues
- npm.io page: https://npm.io/package/add-nginx-ssl

## Recent versions

- 1.2.10 (latest) — 2018-01-05
- 1.2.9 — 2017-10-27
- 1.2.8 — 2017-10-27
- 1.2.7 — 2017-10-27
- 1.2.6 — 2017-10-27
- 1.2.5 — 2017-10-27
- 1.2.4 — 2017-10-27
- 1.2.3 — 2017-10-27
- 1.2.2 — 2017-10-27
- 1.2.1 — 2017-10-27
- 1.2.0 — 2017-10-27
- 1.1.0 — 2017-10-25
- 1.0.0 — 2017-01-16

## README

# add-nginx-ssl

Add SSL config to nginx

```
npm install -g add-nginx-ssl
```

## Usage

``` shell
# setup ssl for example.com
add-nginx-ssl --key my-key.pem --cert my-cert.crt --dhparam my-dhparam.pem --domain example.com

# or if you have a wildcard ssl cert
add-nginx-ssl --key my-key.pem --cert my-cert.crt --dhparam my-dhparam.pem --domain *.example.com

# or to just only allow ssl
add-nginx-ssl --key my-key.pem --cert my-cert.crt --dhparam my-dhparam.pem --all
```

Running the above will write the SSL config to /etc/nginx/conf.d/ssl.conf and reload nginx.

Protip, to generate the dhparam.pem file you can use the following command

``` shell
openssl dhparam -outform pem -out dhparam2048.pem 2048
```

# Using Let's Encrypt

If you don't have a certificate but have certbot installed (the command line tool for [Let's Encrypt](https://letsencrypt.org/)), add-nginx-ssl can auto issue the certificates for you, and start a auto renewel timer using systemd.

``` shell
# use let's encrypt to issue and auto renew the certs
add-nginx-ssl --letsencrypt -d my-domain.com -d my-other-domain.com
```

## License

MIT

---
_Source: https://npm.io/package/add-nginx-ssl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
