F
F
Friend2018-12-24 19:53:50
Django
Friend, 2018-12-24 19:53:50

How to set up https for Django + nginx?

I found the tutorial "Django - Lesson 019. Setting up the HTTPS protocol on the site from Let`s Encrypt" https://evileg.com/en/post/220/ and started trying. The bummer came out on receipt of the certificate, it gives an error:

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Friend, 2018-12-24
@Tiran_94

Here is my nginx file with some revisions that got the certificate

server {
    listen 80;
    server_name example.com www.example.com;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/user/example;
    }

  location /.well-known {
    alias /var/www/example/.well-known;
  }


    location / {
        include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;
    }
}

A
Adil, 2018-12-27
@adilkhash

A long time ago I wrote instructions for deploying a telegram bot on a VPS (Django + nginx + gunicorn + Let's Encrypt). Everything is step by step, it should be clear: https://khashtamov.com/ru/how-to-deploy-django-app/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question