Added ssl

This commit is contained in:
ayxan
2022-10-14 23:04:15 +00:00
parent 569c2ffe79
commit 26ea4c97d3
4 changed files with 130 additions and 2 deletions

View File

@@ -0,0 +1,37 @@
upstream django_server{
server django:8000;
}
server {
listen 80;
server_name series-notification.online;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name series-notification.online;
ssl_certificate /etc/letsencrypt/live/series-notification.online/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/series-notification.online/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://django_server;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /django_static/ {
alias /django_static/;
}
}