Skip to content

Commit 1619fb3

Browse files
author
Matthew Fisher
committed
fix(router): account for dashes in custom domains
confd turns hyphens to dashes, so we need to account for that in domains. Since confd does not have native support for strings.Replace, I've had to fork our current branch and backport strings.Replace as a template function.
1 parent 6aaa411 commit 1619fb3

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

router/image/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ENV DEBIAN_FRONTEND noninteractive
55
# install common packages
66
RUN apt-get update && apt-get install -y curl net-tools sudo
77

8-
# install confd
9-
RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-git-b8e693c \
8+
# install confd from https://github.com/deis/confd/tree/deis
9+
RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-git-4c50136 \
1010
&& chmod +x /usr/local/bin/confd
1111

1212
# install common packages

router/image/templates/nginx.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,11 @@ http {
157157
server {
158158
server_name {{ Base $domain.Key }};
159159
{{/* if a SSL certificate is installed for this domain, use SSL */}}
160-
{{/* Note (bacongobbler): domains are separate from the default platform domain, */}}
160+
{{/* NOTE (bacongobbler): domains are separate from the default platform domain, */}}
161161
{{/* so we can't rely on deis.conf as each domain is an island */}}
162-
{{ if index $root (printf "deis_certs_%s_cert" (Base $domain.Key)) }}
162+
{{/* FIXME (bacongobbler): confd turns hyphens to dashes, so we need to account */}}
163+
{{/* for that in domains */}}
164+
{{ if index $root (printf "deis_certs_%s_cert" (Replace (Base $domain.Key) "-" "_" -1)) }}
163165
server_name_in_redirect off;
164166
port_in_redirect off;
165167
listen 80;

0 commit comments

Comments
 (0)