Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Received and size are the same when using HTTP/2 #45

Open
miroirdelame opened this issue Jul 13, 2016 · 2 comments
Open

Received and size are the same when using HTTP/2 #45

miroirdelame opened this issue Jul 13, 2016 · 2 comments

Comments

@miroirdelame
Copy link

It might be linked to #44 or some other ticket.

When using HTTP/2 in my server configuration, received and size are always the same. Without HTTP/2, it just works fine.

Result of nginx -V :

nginx version: nginx/1.10.1
built with OpenSSL 1.0.2h 3 May 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_secure_link_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-threads --with-file-aio --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/headers-more-nginx-module --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-auth-pam --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-cache-purge --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-dav-ext-module --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-development-kit --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-echo --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/ngx-fancyindex --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-http-push --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-lua --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-upload-progress --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-upstream-fair --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/ngx_http_substitutions_filter_module --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-rtmp-module --add-module=/root/rebuildnginx/nginx-1.10.1/debian/modules/nginx-vod-module

My Nginx configuration is directly taken from Perusio's Drupal for Nginx (for Drupal 7 in my case) : https://github.com/perusio/drupal-with-nginx, but I'm pretty sure it can be reproduced with a more classic configuration.

In my virtualhost file :
WORKS :

listen 443 ssl;
listen [::]:443 ssl;

DOES NOT WORK :

listen 443 ssl http2;
listen [::]:443 ssl http2;

Ask me if you need more info, but it should be easily reproducible.
Thanks in advance.

@GreenReaper
Copy link

Per comment on the above bug:

http2 is using a completely different receive code path than the regular http. The upload tracker is based on nginx internals, and it's not surprising that it doesn't work anymore on new features. It would take some time to find and add the workarounds I had to add for http to the http2 code path, and I never found the spare time to do this (of course Pull Requests are welcome :).

@h2appy
Copy link

h2appy commented Jan 21, 2022

Below is my Dockerfile. In this environment, with http2, "received and size issue" is still there. Please check. Thanks!
{ "state" : "uploading", "received" : 16516, "size" : 3330332 }
{ "state" : "uploading", "received" : 16516, "size" : 3330332 }
{ "state" : "uploading", "received" : 16516, "size" : 3330332 }
...

FROM debian:bullseye-slim
RUN apt-get update
RUN apt-get -y upgrade
WORKDIR /tmp

# Install prerequisites for Nginx compile
RUN apt-get install -y \
    zlib1g \
    zlib1g-dev \
    libpcre3 \
    libpcre3-dev \
    openssl \
    libssl-dev \
    wget \
    tar \
    gcc \
    make \
    git

# Download Nginx and Nginx modules source code
RUN wget http://nginx.org/download/nginx-1.20.2.tar.gz -O nginx.tar.gz && \
    mkdir /tmp/nginx && \
    tar -xzvf nginx.tar.gz -C /tmp/nginx --strip-components=1 &&\
    git clone --branch 2.3.0 https://github.com/vkholodkov/nginx-upload-module.git /tmp/nginx/nginx-upload-module &&\
    git clone --depth=1 https://github.com/masterzen/nginx-upload-progress-module.git /tmp/nginx/nginx-upload-progress-module


# Build Nginx
WORKDIR /tmp/nginx

RUN ./configure \
    --with-cc-opt="-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2" \
    --with-ld-opt="-Wl,-Bsymbolic-functions -Wl,-z,relro" \
    --user=nginx \
    --group=nginx \
    --prefix=/usr/share/nginx \
    --with-http_gunzip_module \
    --with-http_gzip_static_module \
    --with-http_stub_status_module \
    --with-http_ssl_module \
    --with-http_v2_module \
    --with-pcre \
    --with-file-aio \
    --with-stream \
    --with-stream_ssl_module \
    --with-http_auth_request_module \
    --add-module=nginx-upload-module \
    --add-module=nginx-upload-progress-module && \
    make &&\
    make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants