DEV Community

Chris Richmond
Chris Richmond

Posted on

1

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.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay