docker-nginx-fancyindex/services.d/nginx/run

22 lines
378 B
Plaintext
Raw Normal View History

2023-06-18 03:14:24 +00:00
#! /bin/sh
set -eu
exec 2>&1
COMMAND=/usr/sbin/nginx
PID_FILE=/run/nginx/nginx.pid
# Create pid file's directory
install -d -o nginx -g nginx ${PID_FILE%/*}
# Check nginx command is executable or not
test -x ${COMMAND} || exit 0
# Test nginx configuration
${COMMAND} -t -q || exit 0
${COMMAND} -v
exec ${COMMAND} -c /etc/nginx/nginx.conf -g "pid $PID_FILE; daemon off;"