A possible scenario:
sometimes it might happens that, when configuring SSL files (private key and certificate) for the Virtualhost which is being configured,it was forgotten to specify the absolute path where these files reside.
For example, if you follow this official doc from Nginx: http://nginx.org/en/docs/http/configuring_https_servers.html
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate tdmssl.crt;
ssl_certificate_key tdmssl.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
...
}
Suppose that you store the SSL files inside "/etc/nginx/conf.d":
root@ilg40:/etc/nginx/conf.d# pwd
/etc/nginx/conf.d
root@ilg40:/etc/nginx/conf.d# ll
total 16
drwxr-xr-x 2 root root 4096 Jan 24 17:39 ./
drwxr-xr-x 5 root root 4096 Jan 24 21:15 ../
-rw-r--r-- 1 root root 1359 Jan 24 17:39 tdmssl.crt
-rw-r--r-- 1 root root 1675 Jan 24 17:39 tdmssl.key
What happens?
By default, when not specified the absolute path for an ordinary file which is used by Nginx, Nginx will search for the files at "/etc/nginx"
From /var/log/nginx/error.log
2017/01/24 21:05:10 [emerg] 13113#0:
BIO_new_file("/etc/nginx/tdmssl.crt")
failed(SSL:error:02001002:system library:fopen:
No such file or directory:fopen('/etc/nginx/tdmssl.crt','r')
error:2006D080:BIO routines:BIO_new_file:no such file)
What must be done ?
To specify the absolute path of the additional files which are used by your Virtualhost configuration.
Like this:
root@ilg40:/etc/nginx/conf.d# cd
root@ilg40:~# cat /etc/nginx/sites-available/tdm
server {
listen 443 ssl;
server_name tjsdatamanager.redtjs.com;
ssl_certificate /etc/nginx/conf.d/tdmssl.crt;
ssl_certificate_key /etc/nginx/conf.d/tdmssl.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
include proxy_params;
proxy_pass http://unix:/etc/tdm/flask/wsgi.sock;
}
}