Last active
April 9, 2019 14:01
-
-
Save tzmfreedom/1deb368e6b273ca685179ec77bec140b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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