lundi 3 août 2015

nginx proxy elastic beanstalk file upload

I have my application deployed in a docker container using aws elastic beanstalk. It is using nginx as a proxy.

During a multipart form upload (video), i am sending upload progress update using websocket. It's all working fine locally, even with nginx setup as a proxy. However when deployed on elastic beanstalk, when the form is sent, no progress feedback is received. It seems to be waiting for the upload to complete and then every progress update are coming all at once.

Is it possible that something in the nginx configuration is "eating" the file upload and then forward it to my application once it's completed ?

The configuration of nginx on aws beanstalk:

nginx/1.6.2
--prefix=/usr/share/nginx 
--sbin-path=/usr/sbin/nginx 
--conf-path=/etc/nginx/nginx.conf 
--error-log-path=/var/log/nginx/error.log 
--http-log-path=/var/log/nginx/access.log 
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body 
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy 
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi 
--http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi 
--http-scgi-temp-path=/var/lib/nginx/tmp/scgi 
--pid-path=/var/run/nginx.pid 
--lock-path=/var/lock/subsys/nginx 
--user=nginx 
--group=nginx 
--with-file-aio 
--with-ipv6 
--with-http_ssl_module 
--with-http_spdy_module 
--with-http_realip_module 
--with-http_addition_module 
--with-http_xslt_module 
--with-http_image_filter_module 
--with-http_geoip_module 
--with-http_sub_module 
--with-http_dav_module 
--with-http_flv_module 
--with-http_mp4_module 
--with-http_gunzip_module 
--with-http_gzip_static_module 
--with-http_random_index_module 
--with-http_secure_link_module 
--with-http_degradation_module 
--with-http_stub_status_module 
--with-http_perl_module 
--with-mail 
--with-mail_ssl_module 
--with-pcre 
--with-google_perftools_module 
--with-debug 
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 
--with-ld-opt=' -Wl,-E'

nginx.conf

user  nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    access_log    /var/log/nginx/access.log;

    upstream docker {
       server 172.17.0.12:3000;
       keepalive 256;
    }

    map $http_upgrade $connection_upgrade {
        default     "upgrade";
        ""          "";
    }

    server {

        listen 80;
        client_max_body_size 0;

        location / {
            proxy_pass          http://docker;
            proxy_http_version  1.1;
            proxy_set_header    Connection          $connection_upgrade;
            proxy_set_header    Upgrade             $http_upgrade;
            proxy_set_header    Host                $host;
            proxy_set_header    X-Real-IP           $remote_addr;
            proxy_set_header    X-Forwarded-For         $proxy_add_x_forwarded_for;
        }
    }
}




Aucun commentaire:

Enregistrer un commentaire