Commits

Alexey Rakeev committed 3e38160 Draft

Implemented custom configurations per domain

Comments (0)

Files changed (2)

+# This file is auto generated - all your changes could be lost
+# Please put your adjustments into vhost/USER-DOMAIN.cust file
+
 server {
 	set $root	DOCROOT;
 	set $iport	PORT;
 	location ~ /\.ht {
 		deny all;
 	}
+	include vhost/*-DOMAIN.cust;
 	location ~* \.(gif|jpe?g|png|ico|svg|css|js|htc|swf|txt|pdf|rtf|docx?|xlsx?|zip|rar|iso)$ {
 		expires		24h;
 		log_not_found	off;
 	resconf=$NGCONFDIR/vhost/$user-$domain.conf
 
 	sed -e s/ADDR/$ip/g -e s/PORT_SSL/$INTPORT_SSL/g -e s/PORT/$INTPORT/g \
-		-e s/DOMAIN/$domain/g -e s/DOMLOG/$domain/g -e s/ALIAS/"$alias"/g \
 		-e s/DOCROOT_SSL/"${docroot_ssl//\//\/}"/g -e s/DOCROOT/"${docroot//\//\/}"/g \
+		-e s/USER/$user/g -e s/DOMAIN/$domain/g -e s/DOMLOG/$domain/g -e s/ALIAS/"$alias"/g \
 		-e s/LISTEN/"$listen"/g -e s/PROXY/"${proxy//\//\/}"/g -e s/SSL/"${sslconf//\//\/}"/g \
 		$NGCONFDIR/domain.conf > $resconf
 
 
 	mkdir -p $NGCONFDIR/vhost
 	if [ -z $user ]; then
-		rm -rf $NGCONFDIR/vhost/*
+		rm -rf $NGCONFDIR/vhost/*.conf
 		userlist=$(ls -1 $DAUSERDIR)
 	else
 		delete $user