DEV Community

Chris Richmond
Chris Richmond

Posted on

Nginx Issues Hosting a Blazor App

I wanted to create an identity server that could house my authentication and authorization using Duende (previously known as Identity Server 4). Everything worked fine when I was hosting my site in Azure, but when I tried to self host, I ran into unusual openresty errors. Many google/chatgpt requests later I seem to have figured out a solution.

OIDC (at least with Duende) sends the payload back to the calling server via headers, and they are quite large compared to what Nginx expects for normal headers. This caused the requests to fail. The solution was to expand the header size as such

proxy_buffer_size   128k;
proxy_buffers   4 256k;
proxy_busy_buffers_size   256k;
large_client_header_buffers 4 16k;
Enter fullscreen mode Exit fullscreen mode

Since I use nginx proxy manager, to add this to the configuration we need to go into the config files and under
nginx/custom/http_top.conf

The problem has now gone away and I wait for the next mole to pop up to whack back down.

Top comments (0)