mirror of https://github.com/mack-a/v2ray-agent
fix(脚本): 修改Debian8启动nginx报错问题、修改Path展示不全问题
parent
6aeacf7e56
commit
644cce7c36
|
@ -22,3 +22,14 @@ nameserver 8.8.4.4
|
||||||
- 请更换Debian或者Ubuntu,或者拿着vps来私聊作者。
|
- 请更换Debian或者Ubuntu,或者拿着vps来私聊作者。
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/mack-a/v2ray-agent/master/fodder/install/shell_error_02.jpg" width=700>
|
<img src="https://raw.githubusercontent.com/mack-a/v2ray-agent/master/fodder/install/shell_error_02.jpg" width=700>
|
||||||
|
|
||||||
|
## 4.Debian8启动nginx失败
|
||||||
|
### 解决方法一
|
||||||
|
- 手动删除add_header选项
|
||||||
|
```
|
||||||
|
vim /etc/nginx/conf.d/alone.conf
|
||||||
|
# 删除下方代码
|
||||||
|
location / {
|
||||||
|
add_header Strict-Transport-Security "max-age=63072000" always;
|
||||||
|
}
|
||||||
|
```
|
35
install.sh
35
install.sh
|
@ -12,6 +12,10 @@ checkSystem(){
|
||||||
upgrade="yum update -y --skip-broken"
|
upgrade="yum update -y --skip-broken"
|
||||||
elif [[ ! -z `cat /etc/issue | grep -i "debian" | grep -v grep` ]] || [[ ! -z `cat /proc/version | grep -i "debian" | grep -v grep` ]]
|
elif [[ ! -z `cat /etc/issue | grep -i "debian" | grep -v grep` ]] || [[ ! -z `cat /proc/version | grep -i "debian" | grep -v grep` ]]
|
||||||
then
|
then
|
||||||
|
if [[ ! -z `cat /etc/issue|grep -i "8"` ]]
|
||||||
|
then
|
||||||
|
debianVersion=8
|
||||||
|
fi
|
||||||
release="debian"
|
release="debian"
|
||||||
installType='apt -y install'
|
installType='apt -y install'
|
||||||
upgrade="apt update -y"
|
upgrade="apt update -y"
|
||||||
|
@ -505,6 +509,7 @@ initTLSNginxConfig(){
|
||||||
|
|
||||||
# 修改nginx重定向配置
|
# 修改nginx重定向配置
|
||||||
updateRedirectNginxConf(){
|
updateRedirectNginxConf(){
|
||||||
|
|
||||||
cat << EOF > /etc/nginx/conf.d/alone.conf
|
cat << EOF > /etc/nginx/conf.d/alone.conf
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
@ -512,17 +517,37 @@ cat << EOF > /etc/nginx/conf.d/alone.conf
|
||||||
server_name ${domain};
|
server_name ${domain};
|
||||||
return 301 https://${domain}$request_uri;
|
return 301 https://${domain}$request_uri;
|
||||||
}
|
}
|
||||||
server {
|
EOF
|
||||||
|
|
||||||
|
if [[ "${debianVersion}" = "8" ]]
|
||||||
|
then
|
||||||
|
cat << EOF >> /etc/nginx/conf.d/alone.conf
|
||||||
|
server {
|
||||||
listen 31300;
|
listen 31300;
|
||||||
server_name ${domain};
|
server_name ${domain};
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
location / {
|
# location / {
|
||||||
add_header Strict-Transport-Security "max-age=63072000" always;
|
# add_header Strict-Transport-Security "max-age=63072000" always;
|
||||||
}
|
# }
|
||||||
# location ~ /.well-known {allow all;}
|
# location ~ /.well-known {allow all;}
|
||||||
# location /test {return 200 'fjkvymb6len';}
|
# location /test {return 200 'fjkvymb6len';}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
else
|
||||||
|
cat << EOF >> /etc/nginx/conf.d/alone.conf
|
||||||
|
server {
|
||||||
|
listen 31300;
|
||||||
|
server_name ${domain};
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
location / {
|
||||||
|
add_header Strict-Transport-Security "max-age=63072000" always;
|
||||||
|
}
|
||||||
|
# location ~ /.well-known {allow all;}
|
||||||
|
# location /test {return 200 'fjkvymb6len';}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 检查ip
|
# 检查ip
|
||||||
|
@ -3018,7 +3043,7 @@ menu(){
|
||||||
cd
|
cd
|
||||||
echoContent red "\n=============================================================="
|
echoContent red "\n=============================================================="
|
||||||
echoContent green "作者:mack-a"
|
echoContent green "作者:mack-a"
|
||||||
echoContent green "当前版本:v2.2.7"
|
echoContent green "当前版本:v2.2.8"
|
||||||
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
||||||
echoContent green "描述:七合一共存脚本"
|
echoContent green "描述:七合一共存脚本"
|
||||||
echoContent red "=============================================================="
|
echoContent red "=============================================================="
|
||||||
|
|
Loading…
Reference in New Issue