diff --git a/nginx.conf b/nginx.conf index 4c6de26..a435cbf 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,21 +1,31 @@ -upstream cat_bot { - server web:8000; -} server { - listen 80; - listen [::]:80; - server_name localhost; - server_tokens off; + listen 443 ssl; + server_name riopass.ddns.net; + server_tokens off; - location / { - proxy_pass http://cat_bot; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } + ssl_certificate /etc/letsencrypt/live/riopass.ddns.net/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/riopass.ddns.net/privkey.pem; - location /static/ { - alias /app/static/; - } -} + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + + location /static/ { + alias /app/static/; + } + + location / { + proxy_pass http://cat_bot; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-CSRFToken $http_x_csrftoken; + proxy_set_header Cookie $http_cookie; + + # Дополнительные настройки для ASGI + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 86400; + } +} \ No newline at end of file