An error occurred when upgrading http to Https on nginx: No such file or directory

here is my nginx configuration file

 ssl on;
    ssl_certificate 1_www.***.top_bundle;
    ssl_certificate_key 2_www.***.top.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;

this is my https certificate storage path

/usr/local/nginx/conf

permissions are all 777

[root@VM_125_172_centos nginx]-sharp ls -lha /usr/local/nginx/conf
total 92K
drwxr-xr-x  3 root root 4.0K Jan 10 10:47 .
drwxr-xr-x 11 root root 4.0K Jan 10 11:58 ..
-rwxrwxrwx  1 root root 3.6K Jan 10 01:15 1_www.***.top_bundle.crt
-rwxrwxrwx  1 root root 1.7K Jan 10 01:15 2_www.***.top.key

I made a mistake when I executed nginx-s reload

nginx: [emerg] BIO_new_file("/usr/local/nginx/conf/1_www.****.top_bundle") 
failed (SSL: error:02001002:system library:fopen:No such file or 
directory:fopen("/usr/local/nginx/conf/1_www.***.top_bundle","r") 
error:2006D080:BIO routines:BIO_new_file:no such file)
Apr.13,2022

according to the prompt, the file does not exist. The landlord posted the result of ls-lha / usr/local/nginx/conf .


certificates are strongly recommended to be saved in an absolute path to the / root/certs directory, as well as when configured

your ls command shows

1_www.***.top_bundle.crt

your configuration

 ssl_certificate 1_www.***.top_bundle;

the suffix is not correct


the file name is not correct

ssl_certificate 1_www.***.top_bundle; 
=> 
ssl_certificate 1_www.***.top_bundle.crt;
Menu