Skip to content

Instantly share code, notes, and snippets.

@artmouse
Created November 25, 2014 13:39
Show Gist options
  • Save artmouse/b7240992adccca9a5ea2 to your computer and use it in GitHub Desktop.
Save artmouse/b7240992adccca9a5ea2 to your computer and use it in GitHub Desktop.
Enabling and testing SPDY support on Nginx
Enabling SPDY is pretty straightforward, all we need to do is to add the spdy parameter in the listen directives :
listen 443 ssl spdy;
listen [::]:443 ipv6only=on ssl spdy;
Header compression level is customizable using the spdy_headers_comp directive, for example :
spdy_headers_comp 1;
Check the SPDY module documentation for more details.
We can now test if SPDY is correctly enabled by displaying SPDY related embedded variables using the ngx_echo module :
location /spdy
{
echo $spdy;
echo $spdy_request_priority;
}
Accessing the /spdy URL endpoint using a SPDY enabled browser should display the protocol version (SPDY/2 at the time of writing) along with the request priority.
When accessing the URL using Firefox, the following values are displayed :
2
1
When accessing the URL using Chrome, the following values are displayed :
2
0
According to the protocol drafts, stream priority in SPDY/2 ranges from 0 (lowest priority) to 3 (highest priority), whereas in SPDY/3 it ranges from 0 (highest priority) to 7 (lowest priority).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment