aspnet / BasicMiddleware

[Archived] Basic middleware components for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
169 stars 84 forks source link

Issue with ForwardedHeaders middleware in Ubuntu with ngnix in an mvc app that uses Identity Server #233

Closed xrkolovos closed 7 years ago

xrkolovos commented 7 years ago

I have an issue with this middleware. In the begging, i thought it was an Identity Server issue, but i was wrong.

My app uses an OAuth middleware.

I have configured this option in the begging of Configure method

app.UseForwardedHeaders(new ForwardedHeadersOptions
{
    ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});

I have a 302 request that is server from ngnix as 502.

Tratcher commented 7 years ago

What makes you think it's an issue with UseForwardedHeaders? I don't see any errors in your logs.

xrkolovos commented 7 years ago

Sorry for this issue. Didn't check ngnix logs. The problem was *3 upstream sent too big header while reading response header from upstream

so i set up proxy_buffer options

    fastcgi_buffers 128 4096k;
    fastcgi_buffer_size 4096k;
    proxy_buffering on;
    proxy_buffer_size 128k;
    proxy_buffers   4 256k;
    proxy_busy_buffers_size 256k;