#!/bin/sh

export PORT=10080
export SSL_PORT=10443

echo "127.0.0.1 nginx" >> /etc/hosts

cd test
cp -r etc/nginx/* /etc/nginx/
sed -i -e "s|%{PORT}|${PORT}|" -e "s|%{SSL_PORT}|${SSL_PORT}|" /etc/nginx/conf.d/test.conf

cat > /usr/share/nginx/html/index.html <<'EOF'
<html>
  <head>Test</head>
  <body>
    <h1>NGINX Auth-JWT Module Test</h1>
  </body>
</html>
EOF

invoke-rc.d nginx reload
sleep 1

./test.sh


