ASP.NET 5 behind nginx

删除回忆录丶 提交于 2019-12-21 07:56:25

问题


I have a ASP.NET 5 MVC6 application behind a Nginx server that acts as a reverse proxy. Its configuration is :

server {
    listen       80;
    server_name  example.com;

    location / {
            proxy_pass   http://localhost:5000;
            client_max_body_size 50M;
            proxy_set_header Host $host;
    }
 }

It was working very well on Linux until the ASP.NET 5 RC1. Since then, and on Windows before that, the requests to MVC 6 controllers would fail: I see the response but the browser continues to load as if the response was not complete (static files are served correctly). A direct request to http://localhost:5000/api/xxx responds and closes immediatly.

I tried to add proxy_buffering off but it had no effect. I suspect that it is related to the chunked mode but I found nothing online about this.


回答1:


This is a known issue in rc1. The current work around is to add the following to your nginx configuration;

proxy_set_header Connection keep-alive;

Fix is scheduled for rc2.



来源:https://stackoverflow.com/questions/33846148/asp-net-5-behind-nginx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!