Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Use Alternate-Protocol header to advertise SPDY to clients not using it already.
-- the nginx variable $http_x_spdy_protocol contains the value for X-SPDY-Protocol
local SPDY_REQ_HEADER_VAR='http_x_spdy_protocol'
local ALTERNATE_HEADER='Alternate-Protocol'
local ALTERNATE_VALUE='443:npn-spdy/2'
local function is_spdy_on()
local spdy_version = tonumber(ngx.var[SPDY_REQ_HEADER_VAR]) or 0
ngx.log(ngx.DEBUG, 'SPDY Version: ', spdy_version)
return spdy_version ~= 0
end
-- Use Alternate-Protocol header to advertise SPDY
function advertise()
if not is_spdy_on() then
ngx.log(ngx.DEBUG, 'Advertising SPDY')
ngx.header[ALTERNATE_HEADER] = ALTERNATE_VALUE
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.