Skip to content

fromitive/infra-docker-nginx-certbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GET SSL certification with certbot + docker

requirements

1. your domain
2. docker

how to use it

1. execute run.sh with your domain and your email

./run.sh [yourdomain.com] [[email protected]]

now your certification located in ./certificates/live/[yourdomain.com]

(optional) apply your docker nginx server

  1. replace [domain_here] to your domain in ./nginx-ssl/nginx/conf.d/default.conf and specify tarrget to pass your web application
server {
    listen 443 ssl;
    server_name [domain_here];

    ssl_certificate /etc/letsencrypt/live/[domain_here]/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/[domain_here]/privkey.pem;

    location / {
            proxy_pass http://[your application ip(private or public)];
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
  1. run docker-conmpose.yml in nginx-ssl directory
docker compose up -d

(optional) renew your certifications

  1. just run run.sh script in renew directory with nginx container name
./run.sh [nginx container name]

apply test

curl https://yourdomain.com

About

docker + nginx + certbot 예제

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages