HEX
Server: Apache
System: Linux b:u:newjapaneti:1 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64
User: newjapaneti (381717)
PHP: 5.6.30
Disabled: apache_get_modules, apache_get_version, apache_reset_timeout, apache_getenv, apache_note, apache_setenv
Upload Files
File: //sbin/init-scripts/prestart/nginx-config.sh
#!/bin/bash

if [[ "$X_APPLICATION_HTTP_SERVER" != "nginx" ]]; then
    exit 0
fi

HOME_DIR=/var/www/html/
UID_GID=$(stat -c "%u:%g" "$HOME_DIR")

if [ ! -d $HOME_DIR/nginx-conf ]; then

	mkdir -p $HOME_DIR/nginx-conf/conf.d/
	mkdir $HOME_DIR/nginx-conf/default.d/

	cp "/etc/nginx/conf.d/default.tmpl" "$HOME_DIR/nginx-conf/nginx.conf.model"
	cp "/etc/nginx/mime.types" "$HOME_DIR/nginx-conf/"

	chmod -R 644 $HOME_DIR/nginx-conf
	chmod 755 $HOME_DIR/nginx-conf
	chown -R "$UID_GID" $HOME_DIR/nginx-conf
fi

if [ -d /var/lib/nginx ]; then
	chown -R "$UID_GID" /var/lib/nginx;
fi

if [ ! -f $HOME_DIR/nginx-conf/*.conf ]; then
	cp "/etc/nginx/conf.d/default.tmpl" "$HOME_DIR/nginx-conf/nginx.conf"
	chown "$UID_GID" $HOME_DIR/nginx-conf/nginx.conf
fi
if $(grep -q "/var/www/html/nginx-conf/mime.types" $HOME_DIR/nginx-conf/*.conf -r); then
	if [ ! -f $HOME_DIR/nginx-conf/mime.types ]; then
		cp "/etc/nginx/mime.types" "$HOME_DIR/nginx-conf/"
		chown "$UID_GID" "$HOME_DIR/nginx-conf/mime.types"
	fi
fi

exit 0