tobymao / saq

Simple Async Queues
https://saq-py.readthedocs.io/en/latest/
MIT License
577 stars 39 forks source link

Url web prefix #65

Closed prin-it closed 1 year ago

prin-it commented 1 year ago

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

tobymao commented 1 year ago

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

prin-it commented 1 year ago

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),
        ]
    )
tobymao commented 1 year ago

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

prin-it commented 1 year ago

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