Skip to content

Instantly share code, notes, and snippets.

@SnowMB
SnowMB / nginx.tmpl
Created September 16, 2016 08:16
docker-gen_nginx_template
{{ define "upstream" }}
{{ if .Address }}
{{/* If we got the containers from swarm and this container's port is published to host, use host IP:PORT */}}
{{ if and .Container.Node.ID .Address.HostPort }}
# {{ .Container.Node.Name }}/{{ .Container.Name }}
server {{ .Container.Node.Address.IP }}:{{ .Address.HostPort }};
{{/* If there is no swarm node or the port is not published on host, use container's IP:PORT */}}
{{ else if .Address.IP }}
# {{ .Container.Name }}
server {{ .Address.IP }}:{{ .Address.Port }};
@SnowMB
SnowMB / docker-compose.yml
Last active November 9, 2019 20:42
nextcloud_nginx_letsencrypt_mariadb
version: '2'
services:
nginx:
image: jwilder/nginx-proxy
container_name: nginx
ports:
- 80:80
- 443:443