Hi all,
i am new in using Hangfire - if i start it in VisualStudio local it works as expected with xxxx/Hangfire.
But after deploying it to a Rasperry Pi4 OS with working NGinx i always get a 404 for xxxx/Hangfire.
This are my configurations:
Blockquote
public void ConfigureServices(IServiceCollection services)
{
services.AddHangfire(configuration => {
configuration.UseStorage(
new MySqlStorage(
“server=192.168.1.10;uid=root;pwd=XXXXXXXX;database=Hangfire;Allow User Variables=True”,
new MySqlStorageOptions
{
TablesPrefix = “Hangfire”
}
)
);
});
// Add the processing server as IHostedService
services.AddHangfireServer();
}
Blockquote
and in Configure of startup.cs:
Blockquote
app.Use((context, next) =>
{
context.Request.PathBase = “/Hangfire”;
return next();
});
app.UseHangfireDashboard("/Hangfire", new DashboardOptions
{
})
.UseHangfireServer();
backgroundJobs.Enqueue(() => Console.WriteLine("Hello world from Hangfire!"));
Blockquote
Nginx config:
Blockquote
server {
listen 80 default_server;
server_name http://192.168.1.10;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Blockquote
Any ideas what could be the problem ?
Thanks a lot and best regards
Fahri