|
@@ -33,7 +33,7 @@ Show_Help() {
|
|
|
--help, -h Show this help message
|
|
|
--quiet, -q quiet operation
|
|
|
--list, -l List Virtualhost
|
|
|
- --mphp_ver [53~73] Use another PHP version (PATH: /usr/local/php${mphp_ver})
|
|
|
+ --mphp_ver [53~74] Use another PHP version (PATH: /usr/local/php${mphp_ver})
|
|
|
--proxy Use proxy
|
|
|
--add Add Virtualhost
|
|
|
--delete, --del Delete Virtualhost
|
|
@@ -62,7 +62,7 @@ while :; do
|
|
|
;;
|
|
|
--mphp_ver)
|
|
|
mphp_ver=$2; mphp_flag=y; shift 2
|
|
|
- [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-3]$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~73${CEND}"; unset mphp_ver mphp_flag; }
|
|
|
+ [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~74${CEND}"; unset mphp_ver mphp_flag; }
|
|
|
;;
|
|
|
--proxy)
|
|
|
proxy_flag=y; shift 1
|
|
@@ -327,14 +327,12 @@ Print_SSL() {
|
|
|
}
|
|
|
|
|
|
Input_Add_proxy() {
|
|
|
- echo
|
|
|
- while :;do
|
|
|
+ while :; do echo
|
|
|
read -e -p "Please input the correct proxy_pass: " Proxy_Pass
|
|
|
- if [[ -z ${Proxy_Pass} ]]; then
|
|
|
- echo "${CFAILURE}input error! Please only input 1~3 and q${CEND}"
|
|
|
+ if [ -z "$(echo $Proxy_Pass | grep -E '^http://|https://')" ]; then
|
|
|
+ echo "${CFAILURE}input error! Please only input example http://192.168.1.1:8080${CEND}"
|
|
|
else
|
|
|
echo "proxy_pass=${Proxy_Pass}"
|
|
|
- echo
|
|
|
break
|
|
|
fi
|
|
|
done
|
|
@@ -595,7 +593,6 @@ Nginx_rewrite() {
|
|
|
fi
|
|
|
echo "You choose rewrite=${CMSG}$rewrite${CEND}"
|
|
|
[ "${NGX_FLAG}" == 'php' -a "${rewrite}" == "joomla" ] && NGX_CONF=$(echo -e "location ~ \\.php\$ {\n #fastcgi_pass remote_php_ip:9000;\n fastcgi_pass unix:/dev/shm/php${mphp_ver}-cgi.sock;\n fastcgi_index index.php;\n include fastcgi.conf;\n }")
|
|
|
- #[ "${NGX_FLAG}" == 'php' ] && [[ "${rewrite}" =~ ^codeigniter$|^thinkphp$|^pathinfo$ ]] && NGX_CONF=$(echo -e "location ~ [^/]\.php(/|\$) {\n try_files \$uri =404;\n #fastcgi_pass remote_php_ip:9000;\n fastcgi_pass unix:/dev/shm/php${mphp_ver}-cgi.sock;\n fastcgi_index index.php;\n include fastcgi.conf;\n set \$real_script_name \$fastcgi_script_name;\n if (\$fastcgi_script_name ~ \"^(.+?\.php)(/.+)\$\") {\n set \$real_script_name \$1;\n set \$path_info \$2;\n }\n fastcgi_param SCRIPT_FILENAME \$document_root\$real_script_name;\n fastcgi_param SCRIPT_NAME \$real_script_name;\n fastcgi_param PATH_INFO \$path_info;\n }")
|
|
|
[ "${NGX_FLAG}" == 'php' ] && [[ "${rewrite}" =~ ^codeigniter$|^thinkphp$|^pathinfo$ ]] && NGX_CONF=$(echo -e "location ~ [^/]\.php(/|\$) {\n #fastcgi_pass remote_php_ip:9000;\n fastcgi_pass unix:/dev/shm/php${mphp_ver}-cgi.sock;\n fastcgi_index index.php;\n include fastcgi.conf;\n fastcgi_split_path_info ^(.+?\.php)(/.*)\$;\n set \$path_info \$fastcgi_path_info;\n fastcgi_param PATH_INFO \$path_info;\n try_files \$fastcgi_script_name =404; \n }")
|
|
|
[ "${NGX_FLAG}" == 'php' -a "${rewrite}" == "typecho" ] && NGX_CONF=$(echo -e "location ~ .*\.php(\/.*)*\$ {\n #fastcgi_pass remote_php_ip:9000;\n fastcgi_pass unix:/dev/shm/php${mphp_ver}-cgi.sock;\n fastcgi_index index.php;\n include fastcgi.conf;\n set \$path_info \"\";\n set \$real_script_name \$fastcgi_script_name;\n if (\$fastcgi_script_name ~ \"^(.+?\.php)(/.+)\$\") {\n set \$real_script_name \$1;\n set \$path_info \$2;\n }\n fastcgi_param SCRIPT_FILENAME \$document_root\$real_script_name;\n fastcgi_param SCRIPT_NAME \$real_script_name;\n fastcgi_param PATH_INFO \$path_info;\n }")
|
|
|
if [[ ! "${rewrite}" =~ ^magento2$|^pathinfo$ ]]; then
|