tobymao / saq

Simple Async Queues

Home Page:https://saq-py.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Url web prefix

prin-it opened this issue · comments

Hi! Can you add url prefix in saq position arguments for run web behind proxy?

sorry, i don't know what that means, can you explain more?

I use docker compose with traefik proxy. The Web does not run on the root url like site.com . It is necessary to run web applications with the url prefix like site.com/dashboard . Web app (js code) does not know about this prefix and sends requests to the root path (site.com ). You need to make changes to the routes and js code. Is it possible? Thanks!

 app.add_routes(
        [
            web.static("/static", static, append_version=True),
            web.get("/api/queues/{queue}/jobs/{job}", jobs),
            web.post("/api/queues/{queue}/jobs/{job}/retry", retry),
            web.post("/api/queues/{queue}/jobs/{job}/abort", abort),
            web.get("/api/queues", queues_),
            web.get("/api/queues/{queue}", queues_),
            web.get("/", views),
            web.get("/queues/{queue}", views),
            web.get("/queues/{queue}/jobs/{job}", views),
            web.get("/health", health),
        ]
    )

i think the suggested approach would be to configure the proxy to rewrite to the url needed.

thanks for the report, but i think this is out of scope

Ok. I just will open additional port on server for dashboard.