fix: 更新反向代理模板URL并清理证书申请命令格式
将反向代理配置文件URL从reverse-proxy.conf改为reverse-proxy-template.conf以使用最新模板 移除证书申请命令中的多余空格保持格式一致
This commit is contained in:
1 parent
8b2893aaa2
commit
e5b9aa5b49
2 files changed
+32
-1
No files matched your search
@@ -36,7 +36,7 @@ echo "当前定时任务:"
|
|||||||
crontab -l | grep acme
|
crontab -l | grep acme
|
||||||
|
|
||||||
echo "配置反向代理配置文件..."
|
echo "配置反向代理配置文件..."
|
||||||
wget -O /home/web/conf.d/"$domain_name".conf https://raw.githubusercontent.com/kejilion/nginx/main/reverse-proxy.conf
|
wget -O /home/web/conf.d/"$domain_name".conf https://raw.githubusercontent.com/kejilion/nginx/main/reverse-proxy-template.conf
|
||||||
sed -i "s/yuming.com/$domain_name/g" /home/web/conf.d/"$domain_name".conf
|
sed -i "s/yuming.com/$domain_name/g" /home/web/conf.d/"$domain_name".conf
|
||||||
sed -i "s/0.0.0.0/$ip_address/g" /home/web/conf.d/"$domain_name".conf
|
sed -i "s/0.0.0.0/$ip_address/g" /home/web/conf.d/"$domain_name".conf
|
||||||
sed -i "s/0000/$port/g" /home/web/conf.d/"$domain_name".conf
|
sed -i "s/0000/$port/g" /home/web/conf.d/"$domain_name".conf
|
||||||
|
|||||||
Executable
+31
@@ -0,0 +1,31 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name yuming.com;
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
listen [::]:443 ssl;
|
||||||
|
server_name yuming.com;
|
||||||
|
|
||||||
|
ssl_certificate /etc/nginx/certs/yuming.com_cert.pem;
|
||||||
|
ssl_certificate_key /etc/nginx/certs/yuming.com_key.pem;
|
||||||
|
|
||||||
|
try_files $uri $uri/ /index.php?$args;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header Range $http_range;
|
||||||
|
proxy_set_header If-Range $http_if_range;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_pass http://0.0.0.0:0000;
|
||||||
|
|
||||||
|
#the max size of file to upload
|
||||||
|
client_max_body_size 20000m;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user