Skip to content

Commit a15bbaf

Browse files
author
Sam Dodrill
committed
fix(router): add check command for nginx config
Check for `<no value>` in nginx config, which usually means that something is wrong with the configuration in etcd.
1 parent b50268b commit a15bbaf

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

router/bin/check

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
#
3+
# Check that the configuration for deis-router is valid.
4+
#
5+
6+
if grep -q "<no value>" $1 ; then
7+
exit 1
8+
fi
9+
10+
if ! /usr/sbin/nginx -t -c $1 ; then
11+
exit 1
12+
fi

router/conf.d/nginx.conf.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ keys = [
1111
"/deis/controller",
1212
"/deis/builder",
1313
]
14-
check_cmd = "/usr/sbin/nginx -t -c {{ .src }}"
14+
check_cmd = "/app/bin/check {{ .src }}"
1515
reload_cmd = "/usr/sbin/nginx -s reload"

0 commit comments

Comments
 (0)