This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ 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 }}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
nginx: | |
image: jwilder/nginx-proxy | |
container_name: nginx | |
ports: | |
- 80:80 | |
- 443:443 |