mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-02-27 20:53:01 +00:00
add external SSL ( e.g., Nginx reverse proxy)
This commit is contained in:
parent
d8fb09faae
commit
06886ba765
2 changed files with 12 additions and 4 deletions
|
|
@ -526,8 +526,8 @@ prompt_and_setup_ssl() {
|
||||||
read -rp "Choose an option (default 2 for IP): " ssl_choice
|
read -rp "Choose an option (default 2 for IP): " ssl_choice
|
||||||
ssl_choice="${ssl_choice// /}" # Trim whitespace
|
ssl_choice="${ssl_choice// /}" # Trim whitespace
|
||||||
|
|
||||||
# Default to 2 (IP cert) if input is empty or invalid (not 1 or 3)
|
# Default to 2 (IP cert) if input is empty or invalid (not 1 3 or 4)
|
||||||
if [[ "$ssl_choice" != "1" && "$ssl_choice" != "3" ]]; then
|
if [[ "$ssl_choice" != "1" && "$ssl_choice" != "3" && "$ssl_choice" != "4"]]; then
|
||||||
ssl_choice="2"
|
ssl_choice="2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -631,6 +631,10 @@ prompt_and_setup_ssl() {
|
||||||
|
|
||||||
systemctl restart x-ui >/dev/null 2>&1 || rc-service x-ui restart >/dev/null 2>&1
|
systemctl restart x-ui >/dev/null 2>&1 || rc-service x-ui restart >/dev/null 2>&1
|
||||||
;;
|
;;
|
||||||
|
4)
|
||||||
|
# User chose external SSL option
|
||||||
|
echo -e "${green}Using external SSL (e.g., Nginx reverse proxy)...${plain}"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${red}Invalid option. Skipping SSL setup.${plain}"
|
echo -e "${red}Invalid option. Skipping SSL setup.${plain}"
|
||||||
SSL_HOST="${server_ip}"
|
SSL_HOST="${server_ip}"
|
||||||
|
|
|
||||||
|
|
@ -546,8 +546,8 @@ prompt_and_setup_ssl() {
|
||||||
read -rp "Choose an option (default 2 for IP): " ssl_choice
|
read -rp "Choose an option (default 2 for IP): " ssl_choice
|
||||||
ssl_choice="${ssl_choice// /}" # Trim whitespace
|
ssl_choice="${ssl_choice// /}" # Trim whitespace
|
||||||
|
|
||||||
# Default to 2 (IP cert) if input is empty or invalid (not 1 or 3)
|
# Default to 2 (IP cert) if input is empty or invalid (not 1 3 or 4)
|
||||||
if [[ "$ssl_choice" != "1" && "$ssl_choice" != "3" ]]; then
|
if [[ "$ssl_choice" != "1" && "$ssl_choice" != "3" && "$ssl_choice" != "4"]]; then
|
||||||
ssl_choice="2"
|
ssl_choice="2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -659,6 +659,10 @@ prompt_and_setup_ssl() {
|
||||||
|
|
||||||
systemctl restart x-ui >/dev/null 2>&1 || rc-service x-ui restart >/dev/null 2>&1
|
systemctl restart x-ui >/dev/null 2>&1 || rc-service x-ui restart >/dev/null 2>&1
|
||||||
;;
|
;;
|
||||||
|
4)
|
||||||
|
# User chose external SSL option
|
||||||
|
echo -e "${green}Using external SSL (e.g., Nginx reverse proxy)...${plain}"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${red}Invalid option. Skipping SSL setup.${plain}"
|
echo -e "${red}Invalid option. Skipping SSL setup.${plain}"
|
||||||
SSL_HOST="${server_ip}"
|
SSL_HOST="${server_ip}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue