When I enabled ssl using certbot, Django Channels stopped working
I want to activate ssl on my django project, but when I do it using cerbot, Django Channels doesn't work anymore.
this is nginx:
server {
server_name mysite;
location = /favicon.ico { access_log off; log_not_found off;
}
location /static/ {
root /var/www;
}
location /media/ {
root /var/www;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/mysite.ir/fullchain.pem; # managed by
Certbot
ssl_certificate_key /etc/letsencrypt/live/mysite.ir/privkey.pem; # managed by
Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = mysite.ir) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name mysite.ir;
return 404; # managed by Certbot
}
How can I be on ssl and Django channels at the same time?