Self signed Certificate nginx CentOS 6

Posted September 18, 2017 2.6k views

I followed the following tutorial:

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:

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!


Wouter van Acht.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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:

by Mitchell Anicas
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.