fix: start nginx without resolving A-site at boot [deploy]
This commit is contained in:
1 parent
9d5ea0b393
commit
5dc62bd7c4
4 files changed
+47
-11
No files matched your search
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
CONF=/etc/nginx/conf.d/default.conf
|
||||
A_UPSTREAM="${A_UPSTREAM:-http://project57-deploy.ns-project57.svc.cluster.local:3000}"
|
||||
A_UPSTREAM="${A_UPSTREAM%/}"
|
||||
|
||||
NS="$(awk '/^nameserver/{print $2; exit}' /etc/resolv.conf || true)"
|
||||
if [ -z "${NS}" ]; then
|
||||
NS=kube-dns.kube-system.svc.cluster.local
|
||||
fi
|
||||
|
||||
sed -i \
|
||||
-e "s|__RESOLVER__|${NS}|g" \
|
||||
-e "s|__A_UPSTREAM__|${A_UPSTREAM}|g" \
|
||||
"${CONF}"
|
||||
|
||||
nginx -t
|
||||
Reference in new issue
Block a user