Request hangs for nginx reverse proxy to an ASP.NET 5 web application on docker -


i trying nginx, asp.net 5, docker , docker compose working on development environment cannot see working far. this state , let me briefly explain here well.

i have following docker-compose.yml file:

webapp:   build: .   dockerfile: docker-webapp.dockerfile   container_name: hasample_webapp   ports:     - "5090:5090"  nginx:   build: .   dockerfile: docker-nginx.dockerfile   container_name: hasample_nginx   ports:     - "5000:80"   links:     - webapp:webapp 

docker-nginx.dockerfile file:

from nginx copy ./nginx.conf /etc/nginx/nginx.conf 

and docker-webapp.dockerfile file:

from microsoft/aspnet:1.0.0-rc1-update1  copy ./webapp/project.json /app/webapp/ copy ./nuget.config /app/ copy ./global.json /app/ workdir /app/webapp run ["dnu", "restore"] add ./webapp /app/webapp/  expose 5090 entrypoint ["dnx", "run"] 

nginx.conf file:

worker_processes 4;  events { worker_connections 1024; }  http {     upstream web-app {         server webapp:5090;     }      server {       listen 80;        location / {         proxy_pass http://web-app;         proxy_http_version 1.1;         proxy_set_header upgrade $http_upgrade;         proxy_set_header connection 'upgrade';         proxy_set_header host $host;         proxy_cache_bypass $http_upgrade;       }     } } 

all , when run docker-compose up, gets 2 containers , running nice. host, when hit localhost:5000, request hangs , when terminate request, nginx writes out log through docker compose indicating 499 http response.

any idea might missing here?

update:

i added logging asp.net 5 app , when hit localhost:5000, can verify request being send asp.net 5 it's being terminated immediately giving healthy response judging 200 response. then, nginx sits on util terminate request through client.

enter image description here

this known bug in kestrel rc1: https://github.com/aspnet/kestrelhttpserver/issues/341

you can work around forcing connection: keep-alive:

proxy_set_header connection keep-alive; 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -