Skip to content

Instantly share code, notes, and snippets.

@sawanoboly
Last active August 29, 2015 14:17
Show Gist options
  • Save sawanoboly/7185bb71464c062b2f9a to your computer and use it in GitHub Desktop.
Save sawanoboly/7185bb71464c062b2f9a to your computer and use it in GitHub Desktop.
docker run -d -p 443:8080 local/trusterd
SERVER_NAME = "Trusterd"
SERVER_VERSION = "0.0.1"
SERVER_DESCRIPTION = "#{SERVER_NAME}/#{SERVER_VERSION}"
root_dir = "/usr/local/trusterd"
s = HTTP2::Server.new({
#
# required config
#
:port => 8080,
:document_root => "#{root_dir}/htdocs",
:server_name => SERVER_DESCRIPTION,
:worker => "auto",
:server_host => "0.0.0.0",
# debug default: false
:debug => true,
:key => "#{root_dir}/conf/server.key",
:crt => "#{root_dir}/conf/server.crt",
#:dh_params_file => "#{root_dir}/ssl/dh.pem",
:tls => true,
# callback default: false
:callback => true,
# runngin user, start server with root and change to run_user
:run_user => "nobody",
# measuring server status: default false
:server_status => true,
:upstream => true,
})
s.set_map_to_storage_cb {
s.upstream_uri = s.percent_encode_uri
s.upstream_host = "172.17.42.1"
s.upstream_port = 80
}
s.run
// -- snip --
// Force http2 admin and site
define('WP_HOME','https://54.65.224.XXX');
define('WP_SITEURL','https://54.65.224.XXX');
$_SERVER['HTTPS'] = 'on';
// or
// use http2 site only
if ($_SERVER["HTTP_X_FORWARDED_HOST"] == "172.17.42.1") {
$_SERVER['HTTPS']='on';
}
// -- snip --
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment