Follow uvicorn docs

This commit is contained in:
decentral1se 2021-06-11 18:58:29 +02:00
parent 0d66e17f17
commit fd74c5b21d
No known key found for this signature in database
GPG Key ID: 92DAD76BD9567B8A
1 changed files with 11 additions and 8 deletions

View File

@ -5,6 +5,11 @@ events {
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream backend {
server {{ env "STACK_NAME" }}_app:8000;
}
@ -22,16 +27,14 @@ http {
}
location @proxy_to_app {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://backend;
}
}
}