Home > other >  HTTP to HTTPS on NGINX Django server
HTTP to HTTPS on NGINX Django server

Time:10-09

I'm setting up a server on AWS from a Django project and my Nginx gives an error when trying to switch from HTTP to HTTPS. See my file:

host = fantasy name

server {
    listen 80;
    server_name  host;
    return 301 https://host$request_uri;
    location = /favicon.ico { access_log off; log_not_found off; }
    location /staticfiles/ {alias  /home/ubuntu/Filmes/staticfiles/;}

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

} 

Indeed when using the old domain over HTTP I am redirected to HTTPS but I get CONNECTION DENIED TO THIS DNS.

CodePudding user response:

to Turn on HTTPS and access your site over HTTPS, you’ll need an SSL/TLS certificate that sits on your web server . you can get a certificate from a Certificate Authority (CA) like Let’s Encrypt which is free

  • Related