Skip to content

Instantly share code, notes, and snippets.

@nacika-ins
Created May 7, 2016 22:22
Show Gist options
  • Save nacika-ins/93c9884d7a13c98a0be16c5e3515fea0 to your computer and use it in GitHub Desktop.
Save nacika-ins/93c9884d7a13c98a0be16c5e3515fea0 to your computer and use it in GitHub Desktop.
h2o spa
# to find out the configuration commands, run: h2o --help
# 最大コネクション数
max-connections: 1024
max-delegations: 100
# スレッド数
num-threads: 4
# HTTP
listen: 8080
# HTTPS
listen:
port: 8081
ssl:
certificate-file: examples/h2o/server.crt
key-file: examples/h2o/server.key
hosts:
"127.0.0.1.xip.io:8080":
paths:
# 通常のルーティング
/:
file.dir: /www/html
mruby.handler: |
lambda do |env|
f = open("/www/html/index.html")
body = f.read
f.close
return [200, {"x-reproxy-url" => "/"}, [ body ]]
end
# staticファイル
/static/:
file.dir: /www/static
# APIアクセス
# TODO: grpc経由のアクセスにする
/_/:
proxy.reverse.url: http://web:8000/_/
proxy.preserve-host: OFF
proxy.timeout.keepalive: 0
proxy.timeout.io: 30000
access-log: /dev/stdout
error-log: /dev/stderr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment