Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
hosts:
"default":
listen:
port: 8081
ssl:
certificate-file: examples/h2o/server.crt
key-file: examples/h2o/server.key
paths:
/assets:
file.dir: htdocs/assets
/search:
file.dir: htdocs/search
/no-push/assets:
file.dir: htdocs/assets
/no-push/search:
file.dir: htdocs/search
/:
mruby.handler: |
lambda do |env|
push_paths = []
if /(\/|\.html)$/.match(env["PATH_INFO"])
push_paths << "/search/jquery-1.9.1.min.js"
push_paths << "/search/oktavia-jquery-ui.js"
push_paths << "/search/oktavia-english-search.js"
push_paths << "/assets/style.css"
push_paths << "/assets/searchstyle.css"
end
return [399, push_paths.empty? ? {} : {"link" => push_paths.map{|p| "<#{p}>; rel=preload"}.join("\n")}, []]
end
proxy.reverse.url: http://127.0.0.1:8082/
"/no-push":
proxy.reverse.url: http://127.0.0.1:8082/
access-log:
format: '%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i" "push:%{x-http2-push}o" "%{connect-time}x,%{request-total-time}x,%{request-header-time}x,%{request-body-time}x,%{process-time}x,%{response-time}x,%{duration}x"'
path: /dev/stdout
http2-casper: ON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment