Hangfire Discussion

Include URL subpath when using Hangfire Dashboard

dashboard
Tags: #<Tag:0x00007f84fb653e48>

#1

We have implemented a custom IDashboardAuthorizationFilter to authorize user by roles (received from a SAML Token) to access the hangfire dashboard. In our environement everything works fine, but when deployed in the customer environment (Test and Integration) because the js and css files can’t be loaded (404 not found) and the links within the dashboard do not point to the correct URL.

The reason lies in the routing/network configuration:


All calls including the subpath services/m-api are being routed to the backend, the others to the frontend.
Hangfire is being exposed from the backend.

Hangfire uses the root URL (https://intranet.ch/hangfire) whereas it should be using the URL forwarded to the backend (https://intranet.ch/services/m-api/hangfire).

How can we offer a functioning Hangfire Dashboard in the described customer szenario?


#2

@ph.waeber I’m dealing with a similar issue with my application. Were you able to find a solution that worked for you?


#3

I was able to resolve the issue I had by swapping out the Hangfire.AspNetCore nuget for the main Hangfire nuget. Not sure what exactly fixed it, but switching over got my dashboard working. I know that some people had issues with trailing slashes in the url, but that wasn’t an issue for me. Happy coding!