Skip to content

Instantly share code, notes, and snippets.

@keizo042
Last active February 9, 2018 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keizo042/07b1e70dd41dfffa50f57be1c17d7380 to your computer and use it in GitHub Desktop.
Save keizo042/07b1e70dd41dfffa50f57be1c17d7380 to your computer and use it in GitHub Desktop.
server {
listen 80 http2; #h2を有効化
server_name localhost;
# http2_push_preload on; #preload方式のプッシュを有効化
mruby_access_handler_code '
http2 = Nginx::HTTP2.new
if Nginx::Var.new.host == "http2.example.com"
http2.enable_server_push_preload
else
http2.disable_server_push_preload
end
';
location / {
root html;
add_header "Link" "</test.js>;rel=preload"; #Linkヘッダを付ける
index index.html index.htm;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment