You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
522 B

8 years ago
8 years ago
8 years ago
8 years ago
  1. #!/bin/bash
  2. if [[ ! -z $NGINX_CONFIG_TEMPLATE ]]; then
  3. echo $NGINX_CONFIG_TEMPLATE | envtpl > /etc/nginx/nginx.conf
  4. elif [[ ! -z $NGINX_CONFIG_TEMPLATE_B64 ]]; then
  5. echo $NGINX_CONFIG_TEMPLATE_B64 | base64 --decode | envtpl > /etc/nginx/nginx.conf
  6. else
  7. envtpl /etc/nginx/nginx.conf.tpl
  8. fi
  9. if [[ ! -z $NGINX_AUTH_BASIC_USER && ! -z $NGINX_AUTH_BASIC_PASSWORD ]]; then
  10. echo -n "$NGINX_AUTH_BASIC_USER:" > /etc/nginx/.htpasswd
  11. openssl passwd -apr1 $NGINX_AUTH_BASIC_PASSWORD >> /etc/nginx/.htpasswd
  12. fi
  13. exec "$@"