You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when a service is run without a gateway, dstack strips the /proxy/services/<project>/<run> path prefix before forwarding the request upstream. So /proxy/services/<project>/<run>/ becomes /, /proxy/services/<project>/<run>/a/b/c becomes /a/b/c, etc.
This allows API-only services to work out of the box. This also works for web apps that allow configuring the root path but don't expect to receive it in requests, e.g. ASGI apps served with uvicorn.
However, many popular web apps do expect to receive the path prefix in requests if it is configured as their root path. Such apps don't currently work without a gateway.
Solution
Add a boolean service configuration option to control whether the path prefix is stripped, e.g. strip_prefix. The default is strip_prefix: true (current behavior). The option is ignored when running with a gateway.
Would you like to help us implement this feature by sending a PR?
Yes
The text was updated successfully, but these errors were encountered:
Problem
Currently, when a service is run without a gateway,
dstack
strips the/proxy/services/<project>/<run>
path prefix before forwarding the request upstream. So/proxy/services/<project>/<run>/
becomes/
,/proxy/services/<project>/<run>/a/b/c
becomes/a/b/c
, etc.This allows API-only services to work out of the box. This also works for web apps that allow configuring the root path but don't expect to receive it in requests, e.g. ASGI apps served with uvicorn.
However, many popular web apps do expect to receive the path prefix in requests if it is configured as their root path. Such apps don't currently work without a gateway.
Solution
Add a boolean service configuration option to control whether the path prefix is stripped, e.g.
strip_prefix
. The default isstrip_prefix: true
(current behavior). The option is ignored when running with a gateway.Would you like to help us implement this feature by sending a PR?
Yes
The text was updated successfully, but these errors were encountered: