dstack-ingress: add WebSocket proxy support
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- docker, nginx
- Domain
- infrastructure
Research direction
Find the entrypoint containing setup_nginx_conf() and inspect how it generates the nginx location / block. Add the requested WebSocket proxy settings there, then verify that WebSocket requests receive a 101 Upgrade response while regular HTTP traffic continues to work.
Written by the indexing model from the issue text.
Description
The kvin/dstack-ingress:wildcard image generates its nginx config via setup_nginx_conf() in the entrypoint, but the location / block is missing WebSocket upgrade headers. Without these, any WebSocket service behind dstack-ingress gets HTTP 200 instead of 101 Upgrade.
Suggested fix: add these three lines to the location / block in setup_nginx_conf():
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
This is safe for mixed HTTP + WebSocket traffic. $http_upgrade is empty for regular HTTP requests, and upstreams ignore Connection: upgrade when there's no valid Upgrade value. proxy_http_version 1.1 is strictly better than the default 1.0 (also enables keepalive). This is the standard nginx pattern recommended in the nginx WebSocket docs.
Current workaround: override command in docker-compose to patch the generated config before starting nginx:
command:
- bash
- -c
- |
sed -i '/proxy_pass/a\ proxy_http_version 1.1;\n proxy_set_header Upgrade $$http_upgrade;\n proxy_set_header Connection "upgrade";' /etc/nginx/conf.d/default.conf
exec nginx -g "daemon off;"
- Dominant language
- Python
- Stars
- 27
- Forks
- 26
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Dstack-TEE/dstack-examples
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
Dstack-TEE/dstack-examples#106 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
Dstack-TEE/dstack-examples#103 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Oracle example Openapp-idea
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in Dstack-TEE/dstack-examples
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·