{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/468","labels_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/468/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/468/comments","events_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/468/events","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/468","id":121776070,"number":468,"title":"GET Timeout when Kestrel is behind a reverse proxy on Linux","user":{"login":"kpocza","id":6399280,"avatar_url":"https://avatars.githubusercontent.com/u/6399280?v=3","gravatar_id":"","url":"https://api.github.com/users/kpocza","html_url":"https://github.com/kpocza","followers_url":"https://api.github.com/users/kpocza/followers","following_url":"https://api.github.com/users/kpocza/following{/other_user}","gists_url":"https://api.github.com/users/kpocza/gists{/gist_id}","starred_url":"https://api.github.com/users/kpocza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpocza/subscriptions","organizations_url":"https://api.github.com/users/kpocza/orgs","repos_url":"https://api.github.com/users/kpocza/repos","events_url":"https://api.github.com/users/kpocza/events{/privacy}","received_events_url":"https://api.github.com/users/kpocza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-11T19:29:45Z","updated_at":"2015-12-19T06:16:37Z","closed_at":null,"body":"OS: Ubuntu 14.4\r\nASP.NET5 version: RC1\r\nMono: 4.2.1\r\n\r\nI'm exposing 4 kestrel web services on port no. 8000, 8001, 8002 and 8003. When I reach the services from the outside world everything is fine, I get response very fast for every requests (using .NET WebClient).\r\n\r\nHowever my goal is to expose all services on port no. 80 under some designated locations (/api, /papi, etc.) which can be achieved by putting the services behind a reverse proxy. Previously (beta7 era) I was using tinyproxy, however in case of rc1 I experience timeouts for tinyproxy and for nginx, as well.\r\n\r\nIt's makes things even interesting that POST request are fine but GET requests are failing.\r\n\r\nI was doing an strace on the nginx processes.\r\n\r\nThis is a successful request-response for a POST: reading from the network, writing to Kestrel, reading from Kestrel, writing to network.\r\n```\r\n2763  recvfrom(7, \"POST /api/v1/users/register HTTP/1.1\\r\\nContent-Type: application/json\\r\\nHost: ubuntuthriottesthost\\r\\nContent-Length: 97\\r\\nExpect: 100-continue\\r\\nConnection: Keep-Alive\\r\\n\\r\\n\", 1024, 0, NULL, NULL) = 166\r\n2763  sendto(7, \"HTTP/1.1 100 Continue\\r\\n\\r\\n\", 25, 0, NULL, 0) = 25\r\n2763  recvfrom(7, 0x1890990, 97, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)\r\n2763  epoll_wait(14, {{EPOLLIN, {u32=2255806864, u64=139777671487888}}}, 512, 60000) = 1\r\n2763  gettimeofday({1449858779, 255726}, NULL) = 0\r\n2763  recvfrom(7, \"{\\\"Email\\\":\\\"e349c441-6ad1-44e2-802c-9a929b68d3aa@test.hu\\\",\\\"Password\\\":\\\"p@ssw0rd\\\",\\\"Name\\\":\\\"test user\\\"}\", 97, 0, NULL, NULL) = 97\r\n2763  epoll_ctl(14, EPOLL_CTL_MOD, 7, {EPOLLIN|EPOLLOUT|EPOLLET, {u32=2255806864, u64=139777671487888}}) = 0\r\n2763  socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 9\r\n2763  ioctl(9, FIONBIO, [1])            = 0\r\n2763  epoll_ctl(14, EPOLL_CTL_ADD, 9, {EPOLLIN|EPOLLOUT|EPOLLET, {u32=2255807056, u64=139777671488080}}) = 0\r\n2763  connect(9, {sa_family=AF_INET, sin_port=htons(8000), sin_addr=inet_addr(\"127.0.0.1\")}, 16) = -1 EINPROGRESS (Operation now in progress)\r\n2763  epoll_wait(14, {{EPOLLOUT, {u32=2255806864, u64=139777671487888}}, {EPOLLOUT, {u32=2255807056, u64=139777671488080}}}, 512, 60000) = 2\r\n2763  gettimeofday({1449858779, 255959}, NULL) = 0\r\n2763  getsockopt(9, SOL_SOCKET, SO_ERROR, [0], [4]) = 0\r\n2763  writev(9, [{\"POST /v1/users/register HTTP/1.0\\r\\nHost: ubuntuthriottesthost\\r\\nX-Real-IP: 192.168.0.2\\r\\nX-Forwarded-For: 192.168.0.2\\r\\nConnection: close\\r\\nContent-Length: 97\\r\\nContent-Type: application/json\\r\\n\\r\\n\", 189}, {\"{\\\"Email\\\":\\\"e349c441-6ad1-44e2-802c-9a929b68d3aa@test.hu\\\",\\\"Password\\\":\\\"p@ssw0rd\\\",\\\"Name\\\":\\\"test user\\\"}\", 97}], 2) = 286\r\n2763  recvfrom(7, 0x7fff0fa9ab2f, 1, 2, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)\r\n2763  epoll_wait(14, {{EPOLLIN|EPOLLOUT, {u32=2255807056, u64=139777671488080}}}, 512, 60000) = 1\r\n2763  gettimeofday({1449858779, 276793}, NULL) = 0\r\n2763  recvfrom(9, \"HTTP/1.0 200 OK\\r\\nCache-Control: no-cache\\r\\nDate: Fri, 11 Dec 2015 18:32:59 GMT\\r\\nPragma: no-cache\\r\\nContent-Type: application/json; charset=utf-8\\r\\nExpires: -1\\r\\nServer: Kestrel\\r\\nSet-Cookie: ThriotMgmtAuth=CfDJ8A-YPKeA7-lLphX92nmImKg4D7ruQ3WPm4X-9m9wtErvPgerZxjx_KULjxRP54p0aOpdIofeONj-AyuNlKe3kQi1K0mw-IXsBG2mBrXMpGTbcH8l9v1MIhHIbHvHqEzyk7cgp6lzwcvdQ4AcoTzbOu1Sr5VXKJv-Shg35MAJmy988PrtuAPhUVxBHOlDQxz9Wd4Wm_p9Gm2DMVXs7SF4HB3cQUsMVQQqWoW8UT9Q9qfV9gOMKKr8y8kws0bcjFcEsFEczKqfMmzjKKK-vy1moRrDK8Re-THb7Fcg2cADB7v4kytG238WuqqS6SKkIkdRLCyVFr3lZUtiO88lPW00JUs; path=/\\r\\n\\r\\n{\\\"NeedsActivation\\\":false}\", 4096, 0, NULL, NULL) = 585\r\n2763  readv(9, 0x7fff0fa9a920, 1)       = -1 EAGAIN (Resource temporarily unavailable)\r\n2763  epoll_wait(14, {{EPOLLIN|EPOLLOUT, {u32=2255807056, u64=139777671488080}}}, 512, 59979) = 1\r\n2763  gettimeofday({1449858779, 276997}, NULL) = 0\r\n2763  readv(9, [{\"f\\276I\\250\\36\\v\\0p\\212l\\0\\0\\0\\0\\0\\23\\0\\0\\0\\0\\0\\0\\0\\334\\23J\\0\\0\\0\\0\\0c\\10w\\264\\322\\25\\334\\262\\250\\212l\\0\\0\\0\\0\\0\\r\\0\\0\\0\\0\\0\\0\\0\\215\\375I\\0\\0\\0\\0\\0\\22V\\216\\363W&\\212]\\340\\212l\\0\\0\\0\\0\\0\\7\\0\\0\\0\\0\\0\\0\\0\\27\\23J\\0\\0\\0\\0\\0004\\247\\366\\261\\25\\0\\0\\0\\30\\213l\\0\\0\\0\\0\\0\\r\\0\\0\\0\\0\\0\\0\\0\\177\\375I\\0\\0\\0\\0\\0;kGS\\366\\303aHP\\213l\\0\\0\\0\\0\\0\\n\\0\\0\\0\\0\\0\\0\\0%\\341I\\0\\0\\0\\0\\0\\336~\\304\\321\\221\\245\\t\\0\\210\\213l\\0\\0\\0\\0\\0\\n\\0\\0\\0\\0\\0\\0\\0\\333\\341I\\0\\0\\0\\0\\0\\205`\\226\\f\\366]\\n\\0\\300\\213l\\0\\0\\0\\0\\0\\f\\0\\0\\0\\0\\0\\0\\0\\360\\23J\\0\\0\\0\\0\\0\\325\\262\\r\\342\\2140\\336*\\370\\213l\\0\\0\\0\\0\\0\\17\\0\\0\\0\\0\\0\\0\\0\\17\\23J\\0\\0\\0\\0\\0\\272\\312\\3\\243FB\\7\\3560\\214l\\0\\0\\0\\0\\0\\20\\0\\0\\0\\0\\0\\0\\0\\376\\22J\\0\\0\\0\\0\\0\\26ET\\2\\335\\6\\341\\322h\\214l\\0\\0\\0\\0\\0\\22\\0\\0\\0\\0\\0\\0\\0\\37\\23J\\0\\0\\0\\0\\0l&\\366\\374\\2616\\272\\236\\240\\214l\\0\\0\\0\\0\\0\\21\\0\\0\\0\\0\\0\\0\\0002\\23J\\0\\0\\0\\0\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357.\\0\\0\\0\\0\\0\\1\\0\\0\\0\\0\\0\\0\\0\\6\\0\\0\\0\\0\\0\\0\\0\\244\\230J\\0\\0\\0\\0\\0C/\\2\\312\\0\\0\\0\\0\\1\\0\\0\\0\\0\\0\\0\\0\\5\\0\\0\\0\\0\\0\\0\\0\\\\bJ\\0\\0\\0\\0\\0\\276)\\261\\6\\0\\0\\0\\0\\1\\0\\0\\0\\0\\0\\0\\0\\17\\0\\0\\0\\0\\0\\0\\0\\17\\23J\\0\\0\\0\\0\\0\\272\\312\\3\\243FB\\7\\356\\1\\0\\0\\0\\0\\0\\0\\0\\20\\0\\0\\0\\0\\0\\0\\0\\376\\22J\\0\\0\\0\\0\\0\\26ET\\2\\335\\6\\341\\322\\1\\0\\0\\0\\0\\0\\0\\0\\22\\0\\0\\0\\0\\0\\0\\0\\37\\23J\\0\\0\\0\\0\\0l&\\366\\374\\2616\\272\\236\\1\\0\\0\\0\\0\\0\\0\\0\\21\\0\\0\\0\\0\\0\\0\\0002\\23J\\0\\0\\0\\0\\0\\250\\365\\374\\345\\300\\310?\\211\\1\\0\\0\\0\\0\\0\\0\\0\\17\\0\\0\\0\\0\\0\\0\\0D\\23J\\0\\0\\0\\0\\0\\322\\204\\32\\35FB\\7\\356\\1\\0\\0\\0\\0\\0\\0\\0\\4\\0\\0\\0\\0\\0\\0\\0 \\341I\\0\\0\\0\\0\\0\\250\\3650\\0\\0\\0\\0\\0\\1\\0\\0\\0\\0\\0\\0\\0\\n\\0\\0\\0\\0\\0\\0\\0%\\341I\\0\\0\\0\\0\\0\\336~\\304\\321\\221\\245\\t\\0\\1\\0\\0\\0\\0\\0\\0\\0\\16\\0\\0\\0\\0\\0\\0\\0\\200\\341I\\0\\0\\0\\0\\0\\272\"..., 3511}], 1) = 0\r\n2763  close(9)                          = 0\r\n2763  writev(7, [{\"HTTP/1.1 200 OK\\r\\nServer: nginx/1.4.6 (Ubuntu)\\r\\nDate: Fri, 11 Dec 2015 18:32:59 GMT\\r\\nContent-Type: application/json; charset=utf-8\\r\\nTransfer-Encoding: chunked\\r\\nConnection: keep-alive\\r\\nCache-Control: no-cache\\r\\nPragma: no-cache\\r\\nExpires: -1\\r\\nSet-Cookie: ThriotMgmtAuth=CfDJ8A-YPKeA7-lLphX92nmImKg4D7ruQ3WPm4X-9m9wtErvPgerZxjx_KULjxRP54p0aOpdIofeONj-AyuNlKe3kQi1K0mw-IXsBG2mBrXMpGTbcH8l9v1MIhHIbHvHqEzyk7cgp6lzwcvdQ4AcoTzbOu1Sr5VXKJv-Shg35MAJmy988PrtuAPhUVxBHOlDQxz9Wd4Wm_p9Gm2DMVXs7SF4HB3cQUsMVQQqWoW8UT9Q9qfV9gOMKKr8y8kws0bcjFcEsFEczKqfMmzjKKK-vy1moRrDK8Re-THb7Fcg2cADB7v4kytG238WuqqS6SKkIkdRLCyVFr3lZUtiO88lPW00JUs; path=/\\r\\n\\r\\n\", 625}, {\"19\\r\\n\", 4}, {\"{\\\"NeedsActivation\\\":false}\", 25}, {\"\\r\\n\", 2}, {\"0\\r\\n\\r\\n\", 5}], 5) = 661\r\n2763  write(4, \"192.168.0.2 - - [11/Dec/2015:19:32:59 +0100] \\\"POST /api/v1/users/register HTTP/1.1\\\" 200 61 \\\"-\\\" \\\"-\\\"\\n\", 99) = 99\r\n2763  setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0\r\n2763  recvfrom(7, 0x18997c0, 1024, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)\r\n```\r\n\r\nThis is a failing GET: reading from network, writing to Kestrel, reading from Kestrel and nothing more.\r\n```\r\n2763  recvfrom(7, \"GET /api/v1/users/me HTTP/1.1\\r\\nContent-Type: application/json\\r\\nHost: ubuntuthriottesthost\\r\\nCookie: ThriotMgmtAuth=CfDJ8A-YPKeA7-lLphX92nmImKiCbkrbk0IPExBQa4T7QVcSEF5YQ0TiSB4Xl5kdLMDnH3wBUma5Y-32yIx2yqmf-sZSgiKKXwEw81oBZv10Hbr7LGtcWx5O2xMeC5VxhisZHXTGgmEWl3usSJlXMn0CscvW7EFMSp_RjohDX93SmRkq9rV74RfOKCTeJikbO7MT0vlF-eOp4hBrXpLOtOjsA_bs9EBo-WJWtRMxOAKZWhsDqtz1I2mjQi0xem5mNMkUOpbeoa8XC7d4olcgu83F2CKM9TULbZcDx3gbEwJSwMFHzm0OQ4OjpY_8ZadKSZ52uNzxsOlk2ic1_bzNIspuqZE\\r\\n\\r\\n\", 1024, 0, NULL, NULL) = 465\r\n2763  socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 9\r\n2763  ioctl(9, FIONBIO, [1])            = 0\r\n2763  epoll_ctl(14, EPOLL_CTL_ADD, 9, {EPOLLIN|EPOLLOUT|EPOLLET, {u32=2255807057, u64=139777671488081}}) = 0\r\n2763  connect(9, {sa_family=AF_INET, sin_port=htons(8000), sin_addr=inet_addr(\"127.0.0.1\")}, 16) = -1 EINPROGRESS (Operation now in progress)\r\n2763  epoll_wait(14, {{EPOLLOUT, {u32=2255807057, u64=139777671488081}}}, 512, 60000) = 1\r\n2763  gettimeofday({1449858779, 395954}, NULL) = 0\r\n2763  getsockopt(9, SOL_SOCKET, SO_ERROR, [0], [4]) = 0\r\n2763  writev(9, [{\"GET /v1/users/me HTTP/1.0\\r\\nHost: ubuntuthriottesthost\\r\\nX-Real-IP: 192.168.0.2\\r\\nX-Forwarded-For: 192.168.0.2\\r\\nConnection: close\\r\\nContent-Type: application/json\\r\\nCookie: ThriotMgmtAuth=CfDJ8A-YPKeA7-lLphX92nmImKiCbkrbk0IPExBQa4T7QVcSEF5YQ0TiSB4Xl5kdLMDnH3wBUma5Y-32yIx2yqmf-sZSgiKKXwEw81oBZv10Hbr7LGtcWx5O2xMeC5VxhisZHXTGgmEWl3usSJlXMn0CscvW7EFMSp_RjohDX93SmRkq9rV74RfOKCTeJikbO7MT0vlF-eOp4hBrXpLOtOjsA_bs9EBo-WJWtRMxOAKZWhsDqtz1I2mjQi0xem5mNMkUOpbeoa8XC7d4olcgu83F2CKM9TULbZcDx3gbEwJSwMFHzm0OQ4OjpY_8ZadKSZ52uNzxsOlk2ic1_bzNIspuqZE\\r\\n\\r\\n\", 534}], 1) = 534\r\n2763  epoll_wait(14, {{EPOLLIN|EPOLLOUT, {u32=2255807057, u64=139777671488081}}}, 512, 60000) = 1\r\n2763  gettimeofday({1449858779, 399835}, NULL) = 0\r\n2763  recvfrom(9, \"HTTP/1.0 200 OK\\r\\nDate: Fri, 11 Dec 2015 18:32:59 GMT\\r\\nContent-Type: application/json; charset=utf-8\\r\\nServer: Kestrel\\r\\n\\r\\n{\\\"Id\\\":\\\"00613243798e104a45a2b14e6a8645e8\\\",\\\"Name\\\":\\\"test user\\\",\\\"Email\\\":\\\"e349c441-6ad1-44e2-802c-9a929b68d3aa@test.hu\\\"}\", 4096, 0, NULL, NULL) = 235\r\n2763  readv(9, 0x7fff0fa9a920, 1)       = -1 EAGAIN (Resource temporarily unavailable)\r\n2763  epoll_wait(14,  <unfinished ...>\r\n2762  <... epoll_wait resumed> {}, 512, 500) = 0\r\n```\r\nI don't know whether the missing Content-Length header causes this error or there is some networking issue but it's quite strange. And even I don't know whether this is an error really only for GET or it has nothing to do with the HTTP verb.\r\n\r\nThe source code for the whole application is here:\r\nhttps://github.com/kpocza/thriot\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/comments/165953008","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/468#issuecomment-165953008","issue_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/468","id":165953008,"user":{"login":"yaapelsinko","id":9496612,"avatar_url":"https://avatars.githubusercontent.com/u/9496612?v=3","gravatar_id":"","url":"https://api.github.com/users/yaapelsinko","html_url":"https://github.com/yaapelsinko","followers_url":"https://api.github.com/users/yaapelsinko/followers","following_url":"https://api.github.com/users/yaapelsinko/following{/other_user}","gists_url":"https://api.github.com/users/yaapelsinko/gists{/gist_id}","starred_url":"https://api.github.com/users/yaapelsinko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaapelsinko/subscriptions","organizations_url":"https://api.github.com/users/yaapelsinko/orgs","repos_url":"https://api.github.com/users/yaapelsinko/repos","events_url":"https://api.github.com/users/yaapelsinko/events{/privacy}","received_events_url":"https://api.github.com/users/yaapelsinko/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T06:16:37Z","updated_at":"2015-12-19T06:16:37Z","body":"An article: http://www.fallingcanbedeadly.com/posts/http-100-continue-latency-and-you/\r\n\r\nI'm too lame in such matters to understand if is it relevant or not."}}