Last active
February 9, 2018 16:02
-
-
Save keizo042/07b1e70dd41dfffa50f57be1c17d7380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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