Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#540 closed defect (invalid)

ngx_http_spdy_module $spdy variable empty with SPDY connections

Reported by: Tero Kilkanen Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.5.x
Keywords: SPDY Cc:
uname -a: Linux server 3.11.0-19-generic #33~precise1-Ubuntu SMP Wed Mar 12 21:16:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.5.12
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --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/ --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 --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/ngx_pagespeed- --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_geoip_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_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/headers-more-nginx-module --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-auth-pam --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-cache-purge --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-dav-ext-module --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-development-kit --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-echo --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/ngx-fancyindex --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-http-push --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-lua --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-upload-progress --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/nginx-upstream-fair --add-module=/home/tero/nginx-compile/nginx-1.5.12/debian/modules/ngx_http_substitutions_filter_module


I pass SPDY protocol status to my PHP-FPM with the following directive in my PHP location block:

fastcgi_param SPDY $spdy;

When connecting to the website with latest stable Firefox and dumping PHP's $_SERVER array, the following appears for $_SERVERSPDY variable:

SPDY=> string(0) ""

That is, the $spdy variable is an empty string.

Maybe the SPDY 3.1 draft implementation doesn't update the $spdy server variable?

Change History (6)

comment:1 by Valentin V. Bartenev, 10 years ago

Could you provide a debug log?

comment:2 by Tero Kilkanen, 10 years ago

I took a closer look at the issue, and it seems that the problem is somehow in PHP side. I took a tcpdump capture of the FastCGI traffic, and the header is correctly passed to PHP.

So, PHP must have some bug relating to the parsing of FastCGI request headers then. I will try some workarounds to see if I can get over it, and file a bug report in PHP instead.

Sorry for the hasty conclusion.

comment:3 by Valentin V. Bartenev, 10 years ago

Resolution: invalid
Status: newclosed

comment:4 by Tero Kilkanen, 10 years ago

The error was not in PHP side either. I am using a browser that supports SPDY 3, not SPDY 3.1. It seems that nginx supports only SPDY 3.1, not SPDY 3, and therefore the actual connection doesn't use SPDY.

comment:5 by Valentin V. Bartenev, 10 years ago

Note that "latest stable Firefox" is 28, and it supports spdy/3.1.

comment:6 by Tero Kilkanen, 10 years ago

Yes, Firefox stable supports spdy/3.1, but the optimized Firefox build Pale Moon does not support 3.1 yet.

Note: See TracTickets for help on using tickets.