init
This commit is contained in:
14
nginx/updateConfig.sh
Normal file
14
nginx/updateConfig.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 备份并覆盖配置文件
|
||||
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
|
||||
cp nginx.conf /etc/nginx/
|
||||
|
||||
# 测试并重载配置
|
||||
if nginx -t; then
|
||||
systemctl reload nginx
|
||||
echo "配置已生效,HTTPS已启用"
|
||||
else
|
||||
echo "配置测试失败,已恢复备份"
|
||||
cp /etc/nginx/nginx.conf.bak /etc/nginx/nginx.conf
|
||||
fi
|
||||
Reference in New Issue
Block a user