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

@@ -495,7 +495,37 @@ NEWPROXYSITE_CREATE(){
else else
[ "${MAIN_SITE}" != "${SITENAME}" ] && mv ${NM_NGINXPATH}/sites-enabled/${SITENAME}.conf ${nginxconfig} [ "${MAIN_SITE}" != "${SITENAME}" ] && mv ${NM_NGINXPATH}/sites-enabled/${SITENAME}.conf ${nginxconfig}
echo "${SITENAME} ${SERVERNAMES} ${PROXYHOST} ${PROXYPORT} ${PROXYSCHEME} ${WEBSOCKET} ${HSTS} ${EXPLOITS} ${SECURE} " 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}
fi fi
@@ -667,17 +697,20 @@ SITEINFO(){
read -n 1 edit read -n 1 edit
case "${edit}" in 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';; 1) [ "${type}" == "HTTP" ] && type='Proxy' || type='HTTP';;
2) ;; 2) ;;
3) [ "${hsts}" == "-" ] && hsts='Yes' || hsts='-';; 3) [ "${hsts}" == "-" ] && hsts='Yes' || hsts='-';;
4) [ "${wbskt}" == "-" ] && wbskt='Yes' || wbskt='-';; 4) [ "${wbskt}" == "-" ] && wbskt='Yes' || wbskt='-';;
5) [ "${explt}" == "-" ] && explt='Yes' || explt='-';; 5) [ "${explt}" == "-" ] && explt='Yes' || explt='-';;
6) [ "${lock}" == "-" ] && lock='Yes' || lock='-';; 6) [ "${lock}" == "-" ] && lock='Yes' || lock='-';;
7) 7) echo -e "\033[K\n\033[K"
echo -e "\033[K\n\033[K"
echo -en "\033[KEnter new Proxy Address: " 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"; 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" # 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) 9)
echo -e "\033[K\n\033[K" echo -e "\033[K\n\033[K"
echo -en "\033[KEnter new Proxy Port: " 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"; 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" # 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

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