This commit is contained in:
2023-11-11 15:09:58 -06:00
parent d5f62033b0
commit d4a0787638
2 changed files with 42 additions and 8 deletions

View File

@@ -494,8 +494,38 @@ NEWPROXYSITE_CREATE(){
exit 1
else
[ "${MAIN_SITE}" != "${SITENAME}" ] && mv ${NM_NGINXPATH}/sites-enabled/${SITENAME}.conf ${nginxconfig}
sed -i "/set \$forward_scheme/d" ${nginxconfig}; sed -ie "/server {/a ~~~ set $forward_scheme ${PROXYSCHEME};" ${nginxconfig}
sed -i "/set \$server/d" ${nginxconfig}; sed -ie "/set \$forward_scheme/a ~~~ set $server \"${PROXYHOST}\";" ${nginxconfig}
sed -i "/set \$port/d" ${nginxconfig}; sed -ie "/set \$server/a ~~~ set $port ${PROXYPORT};" ${nginxconfig}
sed -i "/server_name/d" ${nginxconfig}; sed -ie "/set \$port/a ~~~
server_name ${SERVERNAMES//,/ };" ${nginxconfig}
if [ "${SECURE}" != "-" ]; then
sed -i "s/#include conf.d\/include\/secure-access.conf/include conf.d\/include\/secure-access.conf/g" ${nginxconfig}
else
sed -i "s/include conf.d\/include\/secure-access.conf/#include conf.d\/include\/secure-access.conf/g" ${nginxconfig}
fi
if [ "${WEBSOCKET}" != "-" ]; then
sed -i "s/#include conf.d\/include\/websocket-support.conf/include conf.d\/include\/websocket-support.conf/g" ${nginxconfig}
else
sed -i "s/include conf.d\/include\/websocket-support.conf/#include conf.d\/include\/websocket-support.conf/g" ${nginxconfig}
fi
if [ "${HSTS}" != "-" ]; then
sed -i "s/#include conf.d\/include\/hsts-support.conf/include conf.d\/include\/hsts-support.conf/g" ${nginxconfig}
else
sed -i "s/include conf.d\/include\/hsts-support.conf/#include conf.d\/include\/hsts-support.conf/g" ${nginxconfig}
fi
if [ "${EXPLOITS}" != "-" ]; then
sed -i "s/#include conf.d\/include\/block-exploits.conf/include conf.d\/include\/block-exploits.conf/g" ${nginxconfig}
else
sed -i "s/include conf.d\/include\/block-exploits.conf/#include conf.d\/include\/block-exploits.conf/g" ${nginxconfig}
fi
sed -i "s/##include/#include/g" ${nginxconfig}
echo "${SITENAME} ${SERVERNAMES} ${PROXYHOST} ${PROXYPORT} ${PROXYSCHEME} ${WEBSOCKET} ${HSTS} ${EXPLOITS} ${SECURE} "
fi
@@ -667,17 +697,20 @@ SITEINFO(){
read -n 1 edit
case "${edit}" in
0) ;;
0) echo -e "\033[K\n\033[K"
echo -en "\033[KEnter new Server Names (comma seperated): "
read -i "${servernames}" -e servernames
echo -e "\033[5A"; for (( c=1; c<=5; c++ )); do echo -e "\033[K"; done; echo -e "\033[5A"
;;
1) [ "${type}" == "HTTP" ] && type='Proxy' || type='HTTP';;
2) ;;
3) [ "${hsts}" == "-" ] && hsts='Yes' || hsts='-';;
4) [ "${wbskt}" == "-" ] && wbskt='Yes' || wbskt='-';;
5) [ "${explt}" == "-" ] && explt='Yes' || explt='-';;
6) [ "${lock}" == "-" ] && lock='Yes' || lock='-';;
7)
echo -e "\033[K\n\033[K"
7) echo -e "\033[K\n\033[K"
echo -en "\033[KEnter new Proxy Address: "
read server
read -i "${server}" -e server
echo -e "\033[5A"; for (( c=1; c<=5; c++ )); do echo -e "\033[K"; done; echo -e "\033[5A"
# echo -e "\033[5A"; echo -e "\033[K"; echo -e "\033[K"; echo -e "\033[K"; echo -e "\033[K"; echo -e "\033[K"; echo -e "\033[5A"
;;
@@ -691,7 +724,7 @@ SITEINFO(){
9)
echo -e "\033[K\n\033[K"
echo -en "\033[KEnter new Proxy Port: "
read port
read -i "${port}" -e port
echo -e "\033[5A"; for (( c=1; c<=5; c++ )); do echo -e "\033[K"; done; echo -e "\033[5A"
# echo -e "\033[5A"; echo -e "\033[K"; echo -e "\033[K"; echo -e "\033[K"; echo -e "\033[K"; echo -e "\033[K"; echo -e "\033[5A"
;;

View File

@@ -2,11 +2,12 @@ server {
set $forward_scheme <<PROXY_SCHEME>>;
set $server "<<PROXY_IP>>";
set $port <<PROXY_PORT>>;
server_name <<SERVER_NAME>>;
listen 80;
listen 443 ssl;
server_name <<SERVER_NAME>>;
#include conf.d/include/secure-access.conf;