Skip to content

Commit 23d3e69

Browse files
Bihan  RanaBihan  Rana
authored andcommitted
Rename sglang_workers.jinja2 to router_workers.jinja2
1 parent f191132 commit 23d3e69

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/dstack/_internal/proxy/gateway/resources/nginx/sglang_workers.jinja2 renamed to src/dstack/_internal/proxy/gateway/resources/nginx/router_workers.jinja2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% for replica in replicas %}
22
# Worker {{ loop.index }}
3-
upstream sglang_worker_{{ ports[loop.index0] }}_upstream {
3+
upstream router_worker_{{ domain|replace('.', '_') }}_{{ ports[loop.index0] }}_upstream {
44
server unix:{{ replica.socket }};
55
}
66

@@ -12,7 +12,7 @@ server {
1212
proxy_send_timeout 300s;
1313

1414
location / {
15-
proxy_pass http://sglang_worker_{{ ports[loop.index0] }}_upstream;
15+
proxy_pass http://router_worker_{{ domain|replace('.', '_') }}_{{ ports[loop.index0] }}_upstream;
1616
proxy_http_version 1.1;
1717
proxy_set_header Host $host;
1818
proxy_set_header X-Real-IP $remote_addr;

src/dstack/_internal/proxy/gateway/services/nginx.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,10 @@ def write_router_workers_conf(self, conf: ServiceConfig, allocated_ports: list[i
228228

229229

230230
def generate_router_workers_config(conf: ServiceConfig, allocated_ports: list[int]) -> str:
231-
"""Generate router workers configuration (generic, uses sglang_workers.jinja2 template)."""
232-
template = read_package_resource("sglang_workers.jinja2")
231+
"""Generate router workers configuration (generic, uses router_workers.jinja2 template)."""
232+
template = read_package_resource("router_workers.jinja2")
233233
return jinja2.Template(template).render(
234+
domain=conf.domain,
234235
replicas=conf.replicas,
235236
ports=allocated_ports,
236237
proxy_port=PROXY_PORT_ON_GATEWAY,

0 commit comments

Comments
 (0)