Sign inSign up

crypticani/nginx

By crypticani

•Updated 5 months ago

Production-ready Nginx 1.30 Alpine image with Certbot, automated renewal and ACME webroot support.

Image
Web servers
0

209

crypticani/nginx repository overview

⁠crypticani/nginx

A lightweight custom Nginx 1.30 image with built-in Certbot support for Let's Encrypt SSL certificates.

This image is based on nginx:1.30.2-alpine and is intended for simple self-hosted reverse proxy setups where Nginx and Certbot run inside the same container.


⁠Features

  • Based on nginx:1.30.2-alpine
  • Includes Certbot for Let's Encrypt SSL certificates
  • Supports HTTP-01 ACME challenge using webroot
  • Includes automatic certificate renewal using cron
  • Reloads Nginx after certificate renewal
  • Validates Nginx configuration before startup
  • Supports reverse proxy usage for multiple subdomains
  • Includes common operational tools:
    • certbot
    • openssl
    • apache2-utils
    • wget
    • curl

⁠Image

docker pull crypticani/nginx:1.30

⁠Docker Compose Example

services:
  nginx:
    image: crypticani/nginx:1.30
    container_name: nginx
    restart: unless-stopped

    ports:
      - "80:80"
      - "443:443"

    extra_hosts:
      - "host.docker.internal:host-gateway"

    environment:
      CERTBOT_EMAIL: [email protected]
      CERTBOT_WEBROOT: /var/www/certbot

    volumes:
      - ./conf.d:/etc/nginx/conf.d
      - ./letsencrypt:/etc/letsencrypt
      - ./logs:/var/log/nginx

⁠Default HTTP Config

Create conf.d/default.conf.

This file handles:

  • Let's Encrypt ACME challenge requests
  • Health check endpoint
  • Dropping unknown HTTP traffic
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name _;

    location = /healthz {
        access_log off;
        default_type text/plain;
        return 200 "ok\n";
    }

    location ^~ /.well-known/acme-challenge/ {
        root /var/www/certbot;
        default_type text/plain;
        try_files $uri =404;
    }

    location / {
        return 444;
    }
}

Start Nginx with only this default HTTP config first:

docker compose up -d

Check container status:

docker ps
⁠Generate SSL Certificate

The image includes a helper script:

generate-cert.sh

Generate a certificate for one subdomain:

docker exec -it nginx generate-cert.sh grafana.example.com

Tag summary

Content type

Image

Digest

sha256:2909486a9…

Size

47.5 MB

Last updated

5 months ago

docker pull crypticani/nginx:1.30