I need to support both http and Https for my service which is using Nginx. Below code in nginx.conf file does this job:
server
{
listen 80 default_server;
listen 443 ssl;
keepalive_timeout 70;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
ssl_certificate /etc/nginx/environments/cer.pem;
ssl_certificate_key /etc/nginx/environments/key.key;
....
....
}
The problem comes in case certificates are not mounted in the folder. In that case Nginx server doesn't reload and doesn't even listens to http. Is there any approach in which the server continue to listen http if any ssl related issue is occurring? Any way in which we can conditionally listens to the port by checking if ssl_certificates are present in directory. Need Help