4 MINDS

Sistema para Gestão de Conhecimento

Aqueduct error Trying to set 'Transfer-Encoding: Chunked'




Aqueduct + Nginx Error

 HttpException: Trying to set 'Transfer-Encoding: Chunked' on HTTP 1.0 headers #0      _HttpHeaders.chunkedTransferEncoding= (dart:io/http_headers.dart:166)
#1      _HttpHeaders._addTransferEncoding (dart:io/http_headers.dart:346)
#2      _HttpHeaders._add (dart:io/http_headers.dart:323)
#3      _HttpHeaders._addAll (dart:io/http_headers.dart:65)
#4      _HttpHeaders.add (dart:io/http_headers.dart:55)
#5      Request.respond (package:aqueduct/src/http/request.dart:273:22)
#6      RequestController._sendResponse (package:aqueduct/src/http/request_controller.dart:292:20)
#7      RequestController.receive (package:aqueduct/src/http/request_controller.dart:136:15)

Solution:

Set http version on proxy
location / {
  proxy_http_version     1.1;
  proxy_set_header X-Real-IP  $remote_addr;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_set_header Host $host;
  proxy_pass http://127.0.0.1:8081/;
}