Skip to content

Instantly share code, notes, and snippets.

@tzmfreedom
Last active April 9, 2019 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzmfreedom/1deb368e6b273ca685179ec77bec140b to your computer and use it in GitHub Desktop.
Save tzmfreedom/1deb368e6b273ca685179ec77bec140b to your computer and use it in GitHub Desktop.
user: nobody
file.custom-handler:
extension: .php
fastcgi.connect:
port: /var/run/php-fpm/php-fpm.sock
type: unix
compress: ON
file.index: [ 'index.html', 'index.htm', 'index.txt', 'index.php' ]
hosts:
"freedom-man.com:443":
listen:
port: 443
host: 0.0.0.0
ssl:
certificate-file: "/etc/pki/tls/certs/localhost-full.crt"
key-file: "/etc/pki/tls/private/localhost.key"
paths:
"/":
# file.etag: OFF
mruby.handler-file: /etc/h2o/handler.rb
file.dir: /var/www/wordpress
redirect:
url: /index.php/
internal: YES
status: 307
mruby.handler-file: /etc/h2o/handler.rb
"/blog":
redirect:
status: 301
url: "https://blog.freedom-man.com/"
"freedom-man.com:80":
listen:
port: 80
host: 0.0.0.0
paths:
"/":
redirect:
status: 301
url: "https://blog.freedom-man.com/"
access-log: /var/log/h2o/access.log
error-log: /var/log/h2o/error.log
pid-file: /var/run/h2o/h2o.pid
Proc.new do |env|
headers = {}
if /\.(css|js)\z/.match(env["PATH_INFO"])
headers["cache-control"] = "max-age=864000"
headers["Expires"] = "10d"
elsif /\.(png|jpg|jpeg|gif)\z/.match(env["PATH_INFO"])
headers["cache-control"] = "max-age=86400"
headers["Expires"] = "1d"
end
[399, headers, []]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment