master 2f8e7b8d7f3a cached
10 files
7.1 KB
2.6k tokens
1 requests
Download .txt
Repository: thecarlo/letsencrypt-docker-nginx
Branch: master
Commit: 2f8e7b8d7f3a
Files: 10
Total size: 7.1 KB

Directory structure:
gitextract_q00882y4/

├── README.md
└── src/
    ├── letsencrypt/
    │   ├── docker-compose.yml
    │   ├── letsencrypt-site/
    │   │   ├── index.html
    │   │   └── styles/
    │   │       └── style.css
    │   └── nginx.conf
    └── production/
        ├── dh-param/
        │   └── dhparam-2048.pem
        ├── docker-compose.yml
        ├── production-site/
        │   ├── index.html
        │   └── styles/
        │       └── style.css
        └── production.conf

================================================
FILE CONTENTS
================================================

================================================
FILE: README.md
================================================
## How to Setup Free SSL Certificates from Let's Encrypt using Docker and Nginx

This is the source code for the guide located at https://www.humankode.com/ssl/how-to-set-up-free-ssl-certificates-from-lets-encrypt-using-docker-and-nginx


================================================
FILE: src/letsencrypt/docker-compose.yml
================================================
version: '3.1'

services:

  letsencrypt-nginx-container:
    container_name: 'letsencrypt-nginx-container'
    image: nginx:1.14.0
    ports:
      - "80:80"
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
      - ./letsencrypt-site:/usr/share/nginx/html
    networks:
      - docker-network

networks:
  docker-network:
    driver: bridge

================================================
FILE: src/letsencrypt/letsencrypt-site/index.html
================================================
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Let's Encrypt First Time Cert Issue Site</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy"
        crossorigin="anonymous">
    <link rel="stylesheet" href="styles/style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4"
        crossorigin="anonymous"></script>
</head>

<body>
    <div class="site-wrapper">
        <h1>Oh, hai there!</h1>
        <p>
            This is the temporary site that will only be used for the very first time SSL certificates are issued by Let's Encrypt's
            certbot.
        </p>
    </div>
</body>

</html>

================================================
FILE: src/letsencrypt/letsencrypt-site/styles/style.css
================================================
html, body {
    height: 100%;
    background-color: #333;
    color: #fff;
}

.site-wrapper {
    margin-top:100px;
    text-align:center;
}

================================================
FILE: src/letsencrypt/nginx.conf
================================================
server {
    listen 80;
    listen [::]:80;
    server_name ohhaithere.com www.ohhaithere.com;

    location ~ /.well-known/acme-challenge {
        allow all;
        root /usr/share/nginx/html;
    }

    root /usr/share/nginx/html;
    index index.html;
}


================================================
FILE: src/production/dh-param/dhparam-2048.pem
================================================
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEArV0Pp7qt4VquZbPd9+ht6zmTVJ3TxW9xzIA7olaBOUcKpLFi6evF
pGTYtwlbBebuvdNFG3B+mF/1rzjkfdp+INShjWvnZLwFJ72i+0YnmQvlnXdTSGGs
7RdtyFAxlU387Qcym6Cfx4jXYAtK3isHW613m5gqsK+DbmyWEv+PXuYzbBFYCQXM
UKKnCuc2SosETm97AMphmpHyku4YF5zFEuoG/tE3YdP6GbadTIt5c4otENo0MyBf
HQyMCCKQ8KGBhb3XWuE2MGlDycAjFhiw22EBPJ5VPyetY8VCvwoL+u/FUow8QvsA
ek0MLIttnVFmXMi6L0C9lC73eCXFiqd0UwIBAw==
-----END DH PARAMETERS-----

================================================
FILE: src/production/docker-compose.yml
================================================
version: '3.1'

services:

  production-nginx-container:
    container_name: 'production-nginx-container'
    image: nginx:1.14.0
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./production.conf:/etc/nginx/conf.d/default.conf
      - ./production-site:/usr/share/nginx/html
      - ./dh-param/dhparam-2048.pem:/etc/ssl/certs/dhparam-2048.pem
      - /docker-volumes/etc/letsencrypt/live/ohhaithere.com/fullchain.pem:/etc/letsencrypt/live/ohhaithere.com/fullchain.pem
      - /docker-volumes/etc/letsencrypt/live/ohhaithere.com/privkey.pem:/etc/letsencrypt/live/ohhaithere.com/privkey.pem
      #for certbot challenges
      - /docker-volumes/data/letsencrypt:/data/letsencrypt
    networks:
      - docker-network

networks:
  docker-network:
    driver: bridge

================================================
FILE: src/production/production-site/index.html
================================================
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Let's Encrypt : Production Site</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy"
        crossorigin="anonymous">
    <link rel="stylesheet" href="styles/style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4"
        crossorigin="anonymous"></script>
</head>

<body>
    <div class="site-wrapper">
        <h1>Oh, hai there!</h1>
        <p>
            This is the production site that runs in a Docker Nginx container and loads the SSL certificates from a mapped docker volume.
        </p>
        <br />
        <p>
            <img src="images/lets-encryptz-cat.jpg" />
        </p>
    </div>
</body>

</html>

================================================
FILE: src/production/production-site/styles/style.css
================================================
html, body {
    height: 100%;
    background-color: #333;
    color: #fff;
}

.site-wrapper {
    margin-top:100px;
    text-align:center;
}

================================================
FILE: src/production/production.conf
================================================
server {
    listen      80;
    listen [::]:80;
    server_name ohhaithere.com www.ohhaithere.com;

    location / {
        rewrite ^ https://$host$request_uri? permanent;
    }

    #for certbot challenges (renewal process)
    location ~ /.well-known/acme-challenge {
        allow all;
        root /data/letsencrypt;
    }
}

#https://ohhaithere.com
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name ohhaithere.com;

    server_tokens off;

    ssl_certificate /etc/letsencrypt/live/ohhaithere.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ohhaithere.com/privkey.pem;

    ssl_buffer_size 8k;

    ssl_dhparam /etc/ssl/certs/dhparam-2048.pem;

    ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
    ssl_prefer_server_ciphers on;

    ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;

    ssl_ecdh_curve secp384r1;
    ssl_session_tickets off;

    # OCSP stapling
    ssl_stapling on;
    ssl_stapling_verify on;
    resolver 8.8.8.8;

    return 301 https://www.ohhaithere.com$request_uri;
}

#https://www.ohhaithere.com
server {
    server_name www.ohhaithere.com;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_tokens off;

    ssl_buffer_size 8k;
    ssl_dhparam /etc/ssl/certs/dhparam-2048.pem;

    ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;

    ssl_ecdh_curve secp384r1;
    ssl_session_tickets off;

    # OCSP stapling
    ssl_stapling on;
    ssl_stapling_verify on;
    resolver 8.8.8.8 8.8.4.4;

    ssl_certificate /etc/letsencrypt/live/ohhaithere.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ohhaithere.com/privkey.pem;

    location / {
        #security headers
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
        add_header X-XSS-Protection "1; mode=block" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header X-Frame-Options "DENY" always;
        #CSP
        add_header Content-Security-Policy "frame-src 'self'; default-src 'self'; script-src 'self' 'unsafe-inline' https://maxcdn.bootstrapcdn.com https://ajax.googleapis.com; img-src 'self'; style-src 'self' https://maxcdn.bootstrapcdn.com; font-src 'self' data: https://maxcdn.bootstrapcdn.com; form-action 'self'; upgrade-insecure-requests;" always;
        add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    }

    root /usr/share/nginx/html;
    index index.html;
}
Download .txt
gitextract_q00882y4/

├── README.md
└── src/
    ├── letsencrypt/
    │   ├── docker-compose.yml
    │   ├── letsencrypt-site/
    │   │   ├── index.html
    │   │   └── styles/
    │   │       └── style.css
    │   └── nginx.conf
    └── production/
        ├── dh-param/
        │   └── dhparam-2048.pem
        ├── docker-compose.yml
        ├── production-site/
        │   ├── index.html
        │   └── styles/
        │       └── style.css
        └── production.conf
Condensed preview — 10 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8K chars).
[
  {
    "path": "README.md",
    "chars": 237,
    "preview": "## How to Setup Free SSL Certificates from Let's Encrypt using Docker and Nginx\n\nThis is the source code for the guide l"
  },
  {
    "path": "src/letsencrypt/docker-compose.yml",
    "chars": 357,
    "preview": "version: '3.1'\n\nservices:\n\n  letsencrypt-nginx-container:\n    container_name: 'letsencrypt-nginx-container'\n    image: n"
  },
  {
    "path": "src/letsencrypt/letsencrypt-site/index.html",
    "chars": 1128,
    "preview": "<!DOCTYPE html>\n<html>\n\n<head>\n    <meta charset=\"utf-8\" />\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n  "
  },
  {
    "path": "src/letsencrypt/letsencrypt-site/styles/style.css",
    "chars": 141,
    "preview": "html, body {\n    height: 100%;\n    background-color: #333;\n    color: #fff;\n}\n\n.site-wrapper {\n    margin-top:100px;\n   "
  },
  {
    "path": "src/letsencrypt/nginx.conf",
    "chars": 259,
    "preview": "server {\n    listen 80;\n    listen [::]:80;\n    server_name ohhaithere.com www.ohhaithere.com;\n\n    location ~ /.well-kn"
  },
  {
    "path": "src/production/dh-param/dhparam-2048.pem",
    "chars": 423,
    "preview": "-----BEGIN DH PARAMETERS-----\nMIIBCAKCAQEArV0Pp7qt4VquZbPd9+ht6zmTVJ3TxW9xzIA7olaBOUcKpLFi6evF\npGTYtwlbBebuvdNFG3B+mF/1r"
  },
  {
    "path": "src/production/docker-compose.yml",
    "chars": 780,
    "preview": "version: '3.1'\n\nservices:\n\n  production-nginx-container:\n    container_name: 'production-nginx-container'\n    image: ngi"
  },
  {
    "path": "src/production/production-site/index.html",
    "chars": 1198,
    "preview": "<!DOCTYPE html>\n<html>\n\n<head>\n    <meta charset=\"utf-8\" />\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n  "
  },
  {
    "path": "src/production/production-site/styles/style.css",
    "chars": 141,
    "preview": "html, body {\n    height: 100%;\n    background-color: #333;\n    color: #fff;\n}\n\n.site-wrapper {\n    margin-top:100px;\n   "
  },
  {
    "path": "src/production/production.conf",
    "chars": 2568,
    "preview": "server {\n    listen      80;\n    listen [::]:80;\n    server_name ohhaithere.com www.ohhaithere.com;\n\n    location / {\n  "
  }
]

About this extraction

This page contains the full source code of the thecarlo/letsencrypt-docker-nginx GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 10 files (7.1 KB), approximately 2.6k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!