Commit dc1d0940 authored by Pelayo Torres's avatar Pelayo Torres
Browse files

fix nginx log level critical

parent 8a666892
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
worker_processes  auto;

error_log  /var/log/nginx/error.log error;
error_log  /var/log/nginx/error.log ${LOG_LEVEL};
pid        /tmp/nginx.pid;

events {
+15 −0
Original line number Diff line number Diff line
@@ -34,5 +34,20 @@ curl -k -retry 30 \
    --header "X-Vault-Token: $VAULT_TOKEN" \
    --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" 2>/dev/null | jq -r '.data.data.key' -j > $CERTS_FOLDER/server.key

LOG_LEVEL=$(echo "${LOG_LEVEL}" | tr '[:upper:]' '[:lower:]')                                 ✔  base 

case "$LOG_LEVEL" in
  critical)
    LOG_LEVEL="crit"
    ;;
  fatal)
    LOG_LEVEL="error"
    ;;
  notset)
    LOG_LEVEL="info"
    ;;
esac

envsubst '$LOG_LEVEL' < /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.tmp
mv /etc/nginx/nginx.conf.tmp /etc/nginx/nginx.conf
nginx
 No newline at end of file