This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/conf/init/service/nginx/run

18 lines
412 B
Text
Raw Normal View History

#! /bin/bash
echo 'Starting nginx'
NAMESERVER=`cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' '`
echo "resolver $NAMESERVER valid=10s;" > /conf/nginx/resolver.conf
if [ -f /conf/stack/ssl.key ]
then
echo "Using HTTPS"
2016-08-10 20:14:33 +00:00
/usr/sbin/nginx -c /conf/nginx/nginx.conf
else
echo "No SSL key provided, using HTTP"
2016-08-10 20:14:33 +00:00
/usr/sbin/nginx -c /conf/nginx/nginx-nossl.conf
fi
echo 'Nginx exited'