Nginx setup help required

EDIT:

I’ve managed to get the certificate set up. However, iinstead of my website showing up, this shows up: https://i.imgur.com/qJgwZtG.png

Here’s a pastebin showing the contents of /etc/nginx/sites-available/default - https://pastebin.com/jJ8muBem

My Python Flask application is running on port 5000. The Flask application is in /home/ubuntu/website/ and the HTML files are in /home/ubuntu/website/templates

What do I need to change in the nginx default file?

Some background:

Initially the port that Flask was using was 80. But during the installation of Nginx, it wanted port 80, so I changed the port of my Flask app to 5000. Perhaps I need to change the port back to 80? But the thing is, if I change the port to 80, when I try to run the Flask app as it will say that port 80 is already being used (by Nginx). I can kill the Nginx processes that are using port 80 but doesn’t Nginx need to be running for the SSL to work? To be honest, I don’t know how Nginx works. I’m very new to this.

Hi @hshafiq

there is already a new Letsencrypt certificate, created today:

Issuer not before not after Domain names LE-Duplicate next LE
Let's Encrypt Authority X3 2019-07-10 2019-10-08 onlineaudioconverter.net - 1 entries duplicate nr. 1
CloudFlare Inc ECC CA-2 2019-07-05 2020-07-04 *.onlineaudioconverter.net, onlineaudioconverter.net, sni.cloudflaressl.com - 3 entries

But your https doesn't work, looks like a blocking firewall, http works.

So it looks that you have already a client installed.

Your web server also states that it’s Werkzeug/0.15.4 Python/3.6.8 and doesn’t mention either Apache or nginx. I’m not sure whether Werkzeug can really run independent of another web server, but if it can, Certbot won’t know how to configure it automatically with a certificate.

@JuergenAuer
I was messing about with Certify for Windows when my website was running on a windows server. I don’t think I created the certificate properly so I’m starting afresh. I moved my website to an Ubuntu server and I’m trying to use Cerbot. I’m new to all of this and it seems like I should install Nginx. So I just tried installing Nginx and got the message “Not attempting to start NGINX, port 80 is already in use.”

My Flask web application is running on port 80. I’m guessing I should run my Flask app on a different port, then try installing Ngnix again. After that I’m not sure what I need to do.

@JuergenAuer @schoen
Just ran Cerbot and I got the following errors: https://i.imgur.com/Oe0pkW9.png
Any idea what’s wrong?

I’ve managed to get the certificate set up. However, iinstead of my website showing up, this shows up: https://i.imgur.com/qJgwZtG.png

Here’s a pastebin showing the contents of /etc/nginx/sites-available/default - https://pastebin.com/jJ8muBem

My Python Flask application is running on port 5000. The Flask application is in /home/ubuntu/website/ and the HTML files are in /home/ubuntu/website/templates

What do I need to change in the nginx default file?

Some background:

Initially the port that Flask was using was 80. But during the installation of Nginx, it wanted port 80, so I changed the port of my Flask app to 5000. Perhaps I need to change the port back to 80? But the thing is, if I change the port to 80, when I try to run the Flask app as it will say that port 80 is already being used (by Nginx). I can kill the Nginx processes that are using port 80 but doesn’t Nginx need to be running for the SSL to work? To be honest, I don’t know how Nginx works. I’m very new to this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.