Skip to content

Instantly share code, notes, and snippets.

@janit
Created June 22, 2015 20:26
Show Gist options
  • Save janit/32a36c5a1dcbbf6bca5d to your computer and use it in GitHub Desktop.
Save janit/32a36c5a1dcbbf6bca5d to your computer and use it in GitHub Desktop.
Example H2O HTTP server configuration for PHP rewrite apps (such as Bolt, WordPress)
# to find out the configuration commands, run: h2o --help
user: www-data
hosts:
"example.com":
listen:
host: xx.xx.xx.xx
port: 443
ssl:
certificate-file: /etc/nginx/ssl/ssl-bundle.crt
key-file: /etc/nginx/ssl/example_com.key
paths:
"/":
file.dir: /var/www/example_com # serve static files if found
file.dirlisting: on
redirect: # if not found, internally redirect to /index.php/<path>
url: /index.php/
internal: YES
status: 307
file.custom-handler: # handle PHP scripts using php-cgi (FastCGI mode)
extension: .php
fastcgi.connect:
port: /var/run/hhvm/hhvm.sock
type: unix
file.index: [ 'index.php', 'index.html' ]
access-log: /var/log/h2o/access-log
error-log: /var/log/h2o/error-log
pid-file: /var/run/h2o/pid
http2-reprioritize-blocking-assets: ON # performance tuning option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment