0>d.MoveNext()

问题描述 投票:0回答:1

NGINX serves our gateway on 8080, authenticating via our AAA server at 8100 and then passing authenticated requests to NGINX on 8081 for routing. Everything works fine straight out of the box with ...


server {
    listen 8080;
    listen [::]:8080;
    server_name _;
    access_log /var/log/nginx/api.auth.log;

    location = /authverify {
        internal;
        proxy_pass http://127.0.0.1:8081/api/v1/aaa/authentication/validate;
        proxy_pass_request_body off;
        proxy_set_header Content-Length "";
        proxy_set_header X-Original-URI $request_uri;
    }

    location /api/v1/aaa/authentication {
    proxy_pass http://127.0.0.1:8081;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location /api {
        auth_request /authverify;
        auth_request_set $auth_header $upstream_http_authorization;
        more_set_headers "Authorization: $auth_header";

        proxy_pass http://127.0.0.1:8081;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

In my case, re-setting

fixed the issue:But this might depend on how your API is handling the request.

NGINX在8080上为我们的网关提供服务,通过我们的AAA服务器在8100上进行验证,然后将验证过的请求传递给8081上的NGINX进行路由。 除了向我们的文件服务器上传文件(任何大小)的请求外,一切都能正常工作。 发送到8080的网关,当连接到8100的AAA被强制关闭时,出现500内部服务器错误。 发送到8081,NGINX路由多部分文件上传内容就好了。1 bytePool, Nullable改变client_max_body_size无济于事;改变keep-alive值也无济于事。 在NGINX中执行multipart的authverify步骤有什么技巧?

非常感谢任何帮助 (我们运行的是nginx 1.6.2,没有安装额外的模块。)
nginx connection multipart auth-request
1个回答
0
投票

Content-Type2019-11-22 05:20:41.896 +00:00 [Error] The server encountered an internal error and was unable to process your request. 请再试一次。 System.IO.IOException: 在Microsoft.AspNetCore.WebUtilities.MultipartReaderStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) 在Microsoft.AspNetCore.WebUtilities.StreamHelperExtensions.DrainAsync(Stream stream, ArrayPool)。

    location = /authverify {
        internal;
        proxy_pass http://127.0.0.1:8081/api/v1/aaa/authentication/validate;
        proxy_pass_request_body off;
        proxy_set_header Content-Length "";
        proxy_set_header Content-Type "";
        proxy_set_header X-Original-URI $request_uri;
    }

1 limit, CancellationToken cancellationToken)在Microsoft.AspNetCore.WebUtilities.MultipartReader.ReadNextSectionAsync(CancellationToken cancellationToken) 在Microsoft.AspNetCore.Http.Features.InnerReadFormAsync(CancellationToken cancellationToken)。 在Microsoft.AspNetCore.Mvc.ModelBinding.FormValueProviderFactory.AddValueProviderAsync(ValueProviderFactoryContext context)处的FormFeature.InnerReadFormAsync(CancellationToken cancellationToken)。 在Microsoft.AspNetCore.Mvc.ModelBinding.CompositeValueProvider.CreateAsync(ActionContext actionContext, IList`1 factories)处,AspNetCore.Mvc.ModelBinding.CompositeValueProvider.CreateAsync(ControllerContext controllerContext)在Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<g__Bind

© www.soinside.com 2019 - 2024. All rights reserved.