contribsys / faktory

Language-agnostic persistent background job server
https://contribsys.com/faktory/
Other
5.76k stars 230 forks source link

Deploying Faktory on Kubernetes is not loading assets like CSS, JS etc #334

Closed navaneeth closed 3 years ago

navaneeth commented 3 years ago

We are deploying Faktory in to Kubernetes. This particular cluster has a public DNS address and a web application running at: dev.company.com. Faktory is installed and UI is routed to dev.company.com/faktory

When I access the Faktory UI, UI loads up but it is missing all the assets. Looking at the network inspector on the browser, it looks like requests are being made to static/*.css, which end up making requests to dev.company.com/static/*.css which is incorrect. In my case, assets will be in dev.company.com/faktory/static/*.css.

Is there a way to rewrite assets URL? Or can we put a prefix for faktory's assets so that I can use ingress rules to rewrite?

mperham commented 3 years ago

See comment here:

https://github.com/contribsys/faktory/blob/91313ba1c503a4f5faf4eb4ee830e6ca9fe62509/webui/web.go#L143

mperham commented 3 years ago

To be clear, you need to set the X-Script-Name HTTP header to the location where you have Faktory mounted.

https://github.com/contribsys/faktory/blob/91313ba1c503a4f5faf4eb4ee830e6ca9fe62509/webui/web.go#L142-L156