Now this is my nginx server config:
server{
listen 443;
ssl_certificate /etc/nginx/conf.d/cert/example.com/fullchain1.pem;
ssl_certificate_key /etc/nginx/conf.d/cert/example.com/privkey1.pem;
server_name super.example.com;
#rewrite ^(.*)$ https://${server_name}$1 permanent;
root /usr/share/nginx/html/pc-super-frontend-fat;
location / {
try_files $uri /index.html;
index index.html index.htm;
}
location ^~ /service/ {
proxy_pass http://k8s-edge-node/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
in every server config file, it contains certificate config:
ssl_certificate /etc/nginx/conf.d/cert/example.com/fullchain1.pem;
ssl_certificate_key /etc/nginx/conf.d/cert/example.com/privkey1.pem;
because I have more than 50 sub domains, if change the certificate, it should change more than 100 files config(80 + 443). is it possible to make the certificate config to a seperate file and just reference it in server config file?
question from:
https://stackoverflow.com/questions/65931069/is-it-possible-to-config-nginx-certificate-in-public-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…