问题
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