Self signed Certificate nginx CentOS 6

September 18, 2017 493 views
Nginx CentOS

I followed the following tutorial: https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-nginx-for-centos-6

I'm not getting any error message in my logs but the certificate isn't working. I think it has to do with this file, which I needed to configure in the tutorial. I thought it was meant to be in the same place as the configuration for my python app.

This is /etc/nginx/conf.d/default.conf:
https://i.imgur.com/0ch03r8.png

I set this file up for my python app while following a course on Udemy, I'm new to all this stuff and would love some help.

Thanks in advance, if you need anything else please ask!

Greetings,

Wouter van Acht.

1 Answer

If you want the Python app to be available on HTTPS, you'll also need to include the information you currently have in the first server block in the second one that has the SSL config.

Take a look at this more up-to-date tutorial for more information on creating a self-signed cert for use with Nginx:

You might also want to consider using Let's Encrypt to generate your certificate. The project was not available at the time that tutorial was written. It greatly simplifies the process of generating and using SSL certs:

In this tutorial, we will show you how to use Let's Encrypt to obtain a free SSL certificate and use it with Nginx on CentOS 7. We will also show you how to automatically renew your SSL certificate. If you're running a different web server, simply follow your web server's documentation to learn how to use the certificate with your setup.
Have another answer? Share your knowledge.