Files
nginx-hls/docker/entrypoint.sh
T
2026-09-27 15:55:38 +08:00

18 lines
423 B
Bash
Executable File

#!/bin/sh
set -eu
: "${PLAYER_ORIGIN:?PLAYER_ORIGIN must be set}"
if ! printf '%s' "$PLAYER_ORIGIN" | grep -Eq '^https?://[A-Za-z0-9._:-]+$'; then
echo "PLAYER_ORIGIN must be an origin such as http://192.168.1.20:3000" >&2
exit 64
fi
envsubst '${PLAYER_ORIGIN}' \
< /etc/nginx/templates/nginx.conf.template \
> /tmp/nginx.conf
nginx -t -c /tmp/nginx.conf
exec nginx -c /tmp/nginx.conf -g 'daemon off;'