Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 915 Bytes

README.md

File metadata and controls

38 lines (31 loc) · 915 Bytes

Nginx Letsencrypt setup

This script helps creating pre-configured virtual hosts using let's encrypt.
It forces https redirection by default.

Installation

First we need some dependencies (only tested on debian based distros)

apt install nginx
pip3 install certbot

Get in from git

git clone https://github.com/alpha14/nginx-le-setup
cd nginx-le-setup

Usage

Example for setting up a static website

sudo ./nginx-le-setup.sh add --name example.com --directory /opt/website --email [email protected]

Example for setting up a service in reverse proxy

sudo ./nginx-le-setup.sh add --name example.com --proxy 8080 --email [email protected]

Configuration file

A config file can be placed in ~/.nginx-le-setup to avoid specifying some parameters

EMAIL="[email protected]"

WEBROOT_PATH="/data/letsencrypt"

# Additional HSTS directive
HSTS="includeSubDomains; preload"