<p>When I put the application into production with pod-managed Kubernetes architecture where it has the possibility of scaling so today it has two servers running the same application, hangfire recognizes both but returns an error 500</p>

<pre><code>Unable to refresh the statistics: the server responded with 500 (error). Try reloading the page manually, or wait for automatic reload that will happen in a minute.
</code></pre>

<p>But when I leave on stage which is the testing application where there is only one server, hangfire works normally.</p>

<p>Hangfire Configuration:</p>

<pre class="lang-cs prettyprint-override"><code>Startup.cs

services.AddHangfire(x =&gt; x.UsePostgreSqlStorage(Configuration.GetConnectionString("DefaultConnection")));


app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
   Authorization = new[] { new AuthorizationFilterHangfire() }
});           
app.UseHangfireServer();

</code></pre>

<p><a href="https://i.stack.imgur.com/Z7w6s.png" rel="nofollow noreferrer">Error</a></p>

<p>You can now add <code>IgnoreAntiforgeryToken</code> to your service which should resolve this issue.</p>
<p>According to <a href="https://github.com/HangfireIO/Hangfire/issues/1248#issuecomment-517357213" rel="nofollow noreferrer">this github post</a>, the issue occured when you had multiple servers running the dashboard and due to load balancing when your request went to different server from the one you originally got the page, you'd see the error.</p>
<p>Adding <code>IgnoreAntiforgeryToken = true</code> to the dashboard should resolve the issue.</p>
<p>Excerpt Taken from <a href="https://github.com/HangfireIO/Hangfire/issues/1248#issuecomment-517357213" rel="nofollow noreferrer">here</a></p>
<pre><code>app.UseHangfireDashboard(&quot;/hangfire&quot;, new DashboardOptions
{
    Authorization = new[] {new HangfireAuthFilter()},
     IgnoreAntiforgeryToken = true                                 // &lt;--This
});
</code></pre>
