Opened 9 years ago

Closed 9 years ago

#673 closed defect (worksforme)

Redirecting with SPDY does not work

Reported by: Ceremony Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.6.x
Keywords: Cc:
uname -a: Linux superconnected.org 3.10.23-xxxx-std-ipv6-64 #1 SMP Tue Mar 18 14:48:24 CET 2014 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.7.7
built by gcc 4.7.2 (Debian 4.7.2-5)
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin --group=www-data --user=www-data --pid-path=/var/run/nginx.pid --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/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-ipv6 --without-http_browser_module --without-http_charset_module --without-http_empty_gif_module --without-http_geo_module --without-http_limit_conn_module --without-http_limit_req_module --without-http_map_module --without-http_memcached_module --without-http_proxy_module --without-http_referer_module --without-http_scgi_module --with-http_spdy_module --without-http_split_clients_module --without-http_ssi_module --with-http_ssl_module --without-http_status_module --without-http_userid_module --without-http_uwsgi_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module

Description

Using SPDY together with a 301 redirect, will result in the client downloading a file, instead of getting redirected.

Here is an example on my server: http://spdy.superconnected.org/

The configuration of the host is as follows:

server {
        listen 80 spdy;

        server_name spdy.superconnected.org;

        return 301 http://nginx.org;
}

Enabling/disabling compression in SPDY or HTTP did not make a difference.

Tested both 1.6.2 and 1.7.7. Config parameters were identical in 1.6.2.
Checked with Firefox Nightly (36.0a 2014-11-28) and Chrome Stable (39.0.2171.71).

Change History (1)

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

Resolution: worksforme
Status: newclosed

It works as expected using the spdycat tool which is able to use SPDY without TLS:

% ./spdycat -v --spdy3-1 --no-tls http://spdy.superconnected.org/
[  0.153] Handshake complete
[  0.153] send SYN_STREAM frame <version=3, flags=1, length=225>
          (stream_id=1, assoc_stream_id=0, pri=3)
          :host: spdy.superconnected.org
          :method: GET
          :path: /
          :scheme: http
          :version: HTTP/1.1
          accept: */*
          accept-encoding: gzip, deflate
          user-agent: spdylay/1.2.3
[  0.252] recv SYN_REPLY frame <version=3, flags=0, length=106>
          (stream_id=1)
          :status: 301
          :version: HTTP/1.1
          content-length: 178
          content-type: text/html
          date: Sat, 29 Nov 2014 14:26:12 GMT
          location: http://nginx.org
          server: nginx
[  0.252] recv SETTINGS frame <version=3, flags=1, length=20>
          (niv=2)
          [4(0):100]
          [7(0):2147483647]
[  0.253] recv WINDOW_UPDATE frame <version=3, flags=0, length=8>
          (stream_id=0, delta_window_size=2147418111)
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
[  0.334] recv DATA frame (stream_id=1, flags=1, length=178)
[  0.334] send GOAWAY frame <version=3, flags=0, length=8>
          (last_good_stream_id=0)

Web browsers don't support SPDY over plain TCP connections, you should configure SPDY over TLS:

server {
    listen 443 ssl spdy;
    server_name spdy.superconnected.org;
    return 301 http://nginx.org;
}
Note: See TracTickets for help on using tickets.