Giter VIP home page Giter VIP logo

nginx-certbot's Introduction

Boilerplate for nginx-revProxy with Wildcard Let’s Encrypt using Cloudflare DNS on docker-compose

init-letsencrypt.sh fetches and ensures the renewal of a Let’s Encrypt certificate for one Wildcard domain in a docker-compose setup with nginx. This is useful when you need to set up nginx as a reverse proxy for an application.

Important

! you should run this directly in your Docker-Apps Folder but be careful about docker-compose.override.yml.MERGE this needs to be merged into your existing docker-compose.override.yml or renamed to be docker-compose.override.yml if it's not there yet.

"DOCKERSERVICEANDPORT" Example Value (server is the internal docker-service name found in docker-compose.yml)

http://server:9000

For non-wildcard just pass "--no-wildcard" to init-letsencrypt.sh

https://letsencrypt.org/docs/rate-limits/

Installation

  1. Install docker-compose

# Define Variables:
DOMAIN_BASE=
MAINSUBDOMAIN=
API_TOKEN=
# http://server:9000
DOCKERSERVICEANDPORT=

git clone https://github.com/ne0YT/nginx-certbot.git
cd nginx-certbot/
chmod +x ./init-letsencrypt.sh
# Replace placeholders with user-provided values
grep -rl 'DOMAIN_BASE' . --exclude-dir=.git | xargs sed -i "s/DOMAIN_BASE/$DOMAIN_BASE/g"
grep -rl 'MAINSUBDOMAIN' . --exclude-dir=.git | xargs sed -i "s/MAINSUBDOMAIN/$MAINSUBDOMAIN/g"
grep -rl 'API_TOKEN' . --exclude-dir=.git | xargs sed -i "s,API_TOKEN,$API_TOKEN,g"
grep -rl 'DOCKERSERVICEANDPORT' . --exclude-dir=.git | xargs sed -i "s,DOCKERSERVICEANDPORT,$DOCKERSERVICEANDPORT,g"
cd ..
cp -rf nginx-certbot/* .
rm -rf nginx-certbot
# not for this service IF there is already override! merge it manually.
# mv docker-compose.override.yml.MERGE docker-compose.override.yml
bash init-letsencrypt.sh -y
docker compose up -d

License

All code in this repository is licensed under the terms of the MIT License. For further information please refer to the LICENSE file.

nginx-certbot's People

Contributors

alexanderdushkin avatar jhyub avatar mestrogov avatar michal-wrzosek avatar ne0yt avatar pixep avatar wm222au avatar wmnnd avatar ynixon avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.