Skip to content

Instantly share code, notes, and snippets.

@analogic
Last active July 25, 2025 16:24
Show Gist options
  • Select an option

  • Save analogic/51fbe91b580d7913b72320f89bf994cc to your computer and use it in GitHub Desktop.

Select an option

Save analogic/51fbe91b580d7913b72320f89bf994cc to your computer and use it in GitHub Desktop.
Poste.io (with Lets Encrypt) + Nginx reverse proxy + Nginx Lets encrypt companion
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
container_name: nginx-proxy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /data/nginx/conf.d:/etc/nginx/conf.d
- /data/nginx/vhost.d:/etc/nginx/vhost.d
- /data/nginx/html:/usr/share/nginx/html
- /data/nginx/certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-letsencrypt
restart: unless-stopped
volumes:
- /data/nginx/conf.d:/etc/nginx/conf.d
- /data/nginx/vhost.d:/etc/nginx/vhost.d
- /data/nginx/html:/usr/share/nginx/html
- /data/nginx/certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- NGINX_DOCKER_GEN_CONTAINER=nginx-proxy
- NGINX_PROXY_CONTAINER=nginx-proxy
mailserver:
image: poste.io/mailserver:dev
container_name: mailserver
restart: unless-stopped
ports:
- "25:25"
- "110:110"
- "143:143"
- "587:587"
- "993:993"
- "995:995"
- "4190:4190"
environment:
- [email protected]
- LETSENCRYPT_HOST=mail.poste.io
- VIRTUAL_HOST=mail.poste.io
- HTTPS=OFF
volumes:
- /etc/localtime:/etc/localtime:ro
- /data/nginx/html/.well-known:/opt/www/.well-known
- /data/mailserver:/data
@fedeaguilera
Copy link

Hi johandroid. I got the same problem. Link the letsencrypt certs from the nginx proxy to the poste.io container =>

    volumes:
      - NGINX_PROXY_PATH/ssl/certs/mail.YOUR_DOMAIN.com/key.pem:/data/ssl/server.key:ro
      - NGINX_PROXY_PATH/ssl/certs/mail.YOUR_DOMAIN.com/fullchain.pem:/data/ssl/ca.crt:ro
      - NGINX_PROXY_PATH/ssl/certs/mail.YOUR_DOMAIN.com/cert.pem:/data/ssl/server.crt:ro

=> https://www.cloudrocket.at/posts/self-hosted-mail-server-with-poste.io-and-nginx/#the-tls-termination-problem

hi guys. if you have a 2 domains. works only one certificate?

@gadonski
Copy link

gadonski commented Jun 6, 2024

using by this way, the BIMI logo will point to wrong address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment