-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update nginx config for server run in docker
- Loading branch information
Showing
1 changed file
with
28 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |