nginx-ssl-cloudflare-by-docker

0.0.6 • Public • Published

nginx-cloudflare-ssl-by-docker

npm i nginx-cloudflare-ssl-by-docker
mv node_modules/nginx-cloudflare-ssl-by-docker/ nginx-cloudflare-ssl-by-docker/
cd nginx-cloudflare-ssl-by-docker/
  • Config domain nginxconf/my_domain.com.conf replace my_domain.com
  • Config cloudflare certbot/cloudflare.ini
dns_cloudflare_email=my_domain@gmail.com
dns_cloudflare_api_key=___GLOBAL_API_KEY___
  • Config setupssl.sh replace my_domain.com
... --cert-name my_domain.com -d my_domain.com
... --cert-name sub.my_domain.com -d *.my_domain.com
  • Run
sudo apt install docker.io

sh setupssl.sh
sh upnginx.sh
  • Setup Domain and Sub Domain
# sudo certbot renew --key-type ecdsa --cert-name my_domain.com --force-renewal
# sudo certbot renew --key-type ecdsa --cert-name sub.my_domain.com --force-renewal

# crontab -e
# 0 0 * * 1 certbot renew --dry-run
# @reboot docker start nginx

curl -X POST "https://api.cloudflare.com/client/v4/zones/___ZONE_ID___/dns_records"\
  -H "X-Auth-Email: my_domain@gmail.com"\
  -H "X-Auth-Key: ___GLOBAL_API_KEY___"\
  -H "Content-Type: application/json"\
  --data '{"type":"A","name":"@","content":"192.168.100.123","ttl":120,"priority":10,"proxied":false}'

curl -X POST "https://api.cloudflare.com/client/v4/zones/___ZONE_ID___/dns_records"\
  -H "X-Auth-Email: my_domain@gmail.com"\
  -H "X-Auth-Key: ___GLOBAL_API_KEY___"\
  -H "Content-Type: application/json"\
  --data '{"type":"AAAA","name":"@","content":"2001:ee0:4141::6ff6","ttl":120,"priority":10,"proxied":false}'

curl -X POST "https://api.cloudflare.com/client/v4/zones/___ZONE_ID___/dns_records"\
  -H "X-Auth-Email: my_domain@gmail.com"\
  -H "X-Auth-Key: ___GLOBAL_API_KEY___"\
  -H "Content-Type: application/json"\
  --data '{"type":"CNAME","name":"api","content":"my_domain.com","ttl":120,"priority":10,"proxied":false}'

# Certificate is saved at: /etc/letsencrypt/live/my_domain.com/fullchain.pem
# Key is saved at:         /etc/letsencrypt/live/my_domain.com/privkey.pem

# Certificate is saved at: /etc/letsencrypt/live/sub.my_domain.com/fullchain.pem
# Key is saved at:         /etc/letsencrypt/live/sub.my_domain.com/privkey.pem

# sudo certbot delete --cert-name my_domain.com
# sudo certbot delete --cert-name sub.my_domain.com
# sudo certbot delete #OR delete more cert-name

Package Sidebar

Install

npm i nginx-ssl-cloudflare-by-docker

Weekly Downloads

5

Version

0.0.6

License

ISC

Unpacked Size

9.89 kB

Total Files

19

Last publish

Collaborators

  • manhavn