Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Http 是什么导致了nginx&;(node/express)在从上游读取响应头时抛出错误:(104:由对等方重置连接) 问题:_Http_Docker_Express_Nginx - Fatal编程技术网

Http 是什么导致了nginx&;(node/express)在从上游读取响应头时抛出错误:(104:由对等方重置连接) 问题:

Http 是什么导致了nginx&;(node/express)在从上游读取响应头时抛出错误:(104:由对等方重置连接) 问题:,http,docker,express,nginx,Http,Docker,Express,Nginx,为什么nginx要重置连接 我们有以下使用nginx和nodejs服务器的docker应用程序体系结构 application_router[a,b,c] -> application_serveices[x,y,z] -> z_node.js -> S3 我有一个600MB的TSV文件,当直接上传到应用程序服务(z)时,z使用nginx代理传递,100%的时间返回200响应 当我上传相同的TSV文件但使用nginx应用程序_路由器(a)->z时,我得到以下错误: 从z开始

为什么nginx要重置连接


我们有以下使用nginx和nodejs服务器的docker应用程序体系结构

application_router[a,b,c] -> application_serveices[x,y,z] -> z_node.js -> S3
我有一个600MB的TSV文件,当直接上传到应用程序服务(z)时,z使用nginx代理传递,100%的时间返回200响应

当我上传相同的TSV文件但使用nginx应用程序_路由器(a)->z时,我得到以下错误:

从z开始: 我没有看到任何运行时错误或docker容器重新启动


应用程序服务[z]nginx.conf文件 应用程序\u路由器nginx.conf文件
node_1      | objectStore:metadata:file { fieldname: 'TSV-FILE',
node_1      |   originalname: 'some.tsv',
node_1      |   encoding: '7bit',
node_1      |   mimetype: 'text/tab-separated-values' }
nginx_proxy      | 192.168.192.1 - - [16/Jan/2019:01:06:18 +0000] "POST /z/api/source/upload HTTP/1.0" 400 0 "-" "PostmanRuntime/7.4.0" "-"
node_1      | 192.168.192.7 - - [16/Jan/2019:01:06:19 +0000] "POST /z/api/source/upload HTTP/1.0" - - "-" "PostmanRuntime/7.4.0" <----- node does not get a http status code
nginx_1       | 172.18.0.1 - - [16/Jan/2019:01:05:44 +0000] "POST /z/api/source/upload HTTP/1.1" 502 157 "-" "PostmanRuntime/7.4.0"
nginx_1       | 2019/01/16 01:05:58 [warn] 6#6: *1 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000004, client: 172.18.0.1, server: localhost.mydomain.com, request: "POST /z/api/source/upload HTTP/1.1", host: "localhost.mydomain.com"
nginx_1       | 2019/01/16 01:06:18 [error] 6#6: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.18.0.1, server: localhost.mydomain.com, request: "POST /z/api/source/upload HTTP/1.1", upstream: "http://172.18.0.2:4410/z/api/source/upload", host: "localhost.mydomain.com"
nginx_1       | 172.18.0.1 - - [16/Jan/2019:01:06:18 +0000] "POST /z/api/source/upload HTTP/1.1" 502 157 "-" "PostmanRuntime/7.4.0"
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
  worker_connections  1024;
}


http {
  include       /etc/nginx/mime.types;
  default_type  application/octet-stream;

  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';

  access_log  /var/log/nginx/access.log  main;

  proxy_buffering              off;
  proxy_request_buffering      off;
  proxy_connect_timeout       600s;
  proxy_send_timeout          600s;
  proxy_read_timeout          600s;
  send_timeout                600s;
  client_max_body_size          0;

    server {
      listen 80;
      index index.html;
      root /app;

      location /z/ {
        tcp_nopush     on;
        alias /app/;
        try_files $uri$args $uri$args/ /index.html;
      }

      location /z/assets/ {
        alias /app/assets/;
            try_files $uri =404;
      }

      location /z/api/ {
        tcp_nopush     off;
        proxy_pass http://service/z/api/;
        auth_basic          off;
      }
    }
}
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
  worker_connections  1024;
}

http {


    proxy_buffering              off;
    proxy_request_buffering      off;
    proxy_connect_timeout       600s;
    proxy_send_timeout          600s;
    proxy_read_timeout          600s;
    client_max_body_size          0;

    server {
        listen 80 default_server;
        listen [::]:80 default_server;
        server_name _;
        return 301 https://$host$request_uri;
    }

    server {
        listen [::]:443 ssl default_server;
        ssl_certificate /run/secrets/fullchain.pem;
        ssl_certificate_key /run/secrets/privkey.pem;
        return 301 https://$host$request_uri;
    }

    server {
        listen 443;
        ssl on;
        ssl_certificate /run/secrets/fullchain.pem;
        ssl_certificate_key /run/secrets/privkey.pem;
        ssl_dhparam /run/secrets/dhparam.pem;
        server_name  localhost.mydomain.com;

        location / {
            rewrite ^ https://$host/x/ redirect;
        }

        location /x/ {
            proxy_pass http://devstation:4010/x/;
        }

        location /y/ {
            proxy_pass http://devstation:4110/y/;
        }


        location /z/ {
            proxy_pass http://devstation:4410/z/;
        }
    }
}