Skip to content

Instantly share code, notes, and snippets.

@mjstrasser
Last active October 15, 2020 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mjstrasser/78d47b99efa7fbae2dc9634012ef6c18 to your computer and use it in GitHub Desktop.
Save mjstrasser/78d47b99efa7fbae2dc9634012ef6c18 to your computer and use it in GitHub Desktop.
Run Seq with mkcert, NGINX SSL offloading in Docker Compose

What this does

Runs a single-user instance of Seq in Docker with NGINX offloading of a mkcert certificate, listening on port 45341. It also runs the Seq GELF listener in a third container.

Prerequisites

  • mkcert installed.
  • Docker.
  • Suitable directory structure, e.g. ~/Seq with directories nginx and seq.

Generate cert and key

  1. Decide on a host name to use, e.g. seq.local.
  2. Generate cert and key into nginx/ssl directory with: mkcert seq.local.

Edit /etc/hosts

Add a line with:

127.0.0.1 seq.local

Create nginx.conf

In the nginx directory, see below for an example.

Create docker-compose.yml

In the base directory, see below for an example.

Start and use

Use docker-compose up -d Go to https://seq.local:45341

version: '3'
services:
seq:
image: datalust/seq:latest
container_name: seq
volumes:
- ./seq:/data
environment:
- ACCEPT_EULA=Y
restart: unless-stopped
nginx:
image: nginx:alpine
container_name: nginx_seq
ports:
- "45341:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl:/ssl
- ./nginx/log:/log
restart: unless-stopped
depends_on:
- "seq"
seq-elf:
image: datalust/sqelf:latest
container_name: seq_elf
ports:
- "12201:12201/udp"
environment:
- SEQ_ADDRESS=http://seq:5341
restart: unless-stopped
depends_on:
- "seq"
events {
}
http {
server {
listen 443 ssl;
server_name seq.local;
ssl_certificate /ssl/seq.local.pem;
ssl_certificate_key /ssl/seq.local-key.pem;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!RC4:!3DES:!aDSS:!aNULL:!kPSK:!kSRP:!MD5:@STRENGTH:+SHA1:+kRSA;
ssl_prefer_server_ciphers on;
access_log /log/access.log;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://seq;
proxy_read_timeout 90;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment