Skip to content

Instantly share code, notes, and snippets.

View anand-kashyap's full-sized avatar

Anand Kashyap anand-kashyap

View GitHub Profile
@anand-kashyap
anand-kashyap / nginxSubGen.sh
Created December 27, 2020 08:37
Create a nodejs subdomain config for nginx and optionally register ssl via letsencrypt
#!/bin/bash
#
# make script executable first with chmod +x scriptname
# Bash script for generating new subdomain with a new server block(nodejs by default) in Nginx.
# syntax - ./{scriptname} subDomainName mainDomainName PORT
# note - needs certbot enabled for letsencrypt
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green