Skip to content

Commit

Permalink
Update nginx config for server run in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
1517mb committed Jan 14, 2025
1 parent 1eee319 commit 8623606
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 8623606

Please sign in to comment.