forked from centminmod/centminmod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx_errorpage.inc
35 lines (23 loc) · 1.1 KB
/
nginx_errorpage.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function funct_nginxerrorpages {
echo "*************************************************"
cecho "* Custom error page setup for Nginx " $boldgreen
echo "*************************************************"
echo "checking if /usr/local/nginx/conf/errorpage.conf"
echo "and custom error pages already exists"
echo "before setting up /usr/local/nginx/conf/errorpage.conf"
echo ""
if [[ ! -f /usr/local/nginx/html/404.html && ! -f /usr/local/nginx/conf/errorpage.conf ]]; then
echo "/usr/local/nginx/conf/errorpage.conf and custom error pages don't exist"
echo "setting up errorpage.conf and custom error pages ..."
echo ""
cp -R $CUR_DIR/htdocs/custom_errorpages/* /usr/local/nginx/html
cp $CUR_DIR/config/nginx/errorpage.conf /usr/local/nginx/conf
sed -i 's/include \/usr\/local\/nginx\/conf\/drop.conf;/include \/usr\/local\/nginx\/conf\/drop.conf;\n#include \/usr\/local\/nginx\/conf\/errorpage.conf;/g' /usr/local/nginx/conf/conf.d/*.conf
else
echo "/usr/local/nginx/conf/errorpage.conf and custom error pages"
echo "already exists ... aborting"
echo ""
exit
fi
echo "*************************************************"
}