httpd.conf 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. LoadModule logio_module modules/mod_logio.so
  2. LoadModule rewrite_module modules/mod_rewrite.so
  3. LoadModule expires_module modules/mod_expires.so
  4. LogFormat "[%{%Y-%m-%dT%T}t.%{msec_frac}t%{%z}t] %h:%p %u %L %H \"%m %U%q\" %>s %OB (%{ms}Tms) \"%{Referer}i\" \"%{User-Agent}i\""
  5. TransferLog /proc/self/fd/1
  6. ErrorLogFormat "%v %A %-L [%{cu}t] [%m] %l: %M (%E) @%F [client\ %a] [pid %P tid %T] \"%-{Referer}i\" \"%-{User-Agent}i\""
  7. DocumentRoot /var/www/
  8. <Directory /var/www/>
  9. Require all granted
  10. Options FollowSymLinks
  11. AllowOverride None
  12. # Don’t require slashes at the end of URLs
  13. DirectorySlash Off
  14. RewriteEngine On
  15. RewriteCond %{REQUEST_FILENAME} -d
  16. RewriteRule ^(.++)$(?<!\/) /$1/ [L]
  17. </Directory>
  18. # Default cache headers
  19. ExpiresActive On
  20. ExpiresDefault "access plus 1 hour"
  21. Header append Cache-Control "public"
  22. # Set long time cache header on hashed files
  23. <FilesMatch "\.[a-f0-9]{6}\.(css|jpg|png|svg|html|ico|js|ttf|otf|eot)$">
  24. ExpiresDefault "access plus 1 year"
  25. Header unset ETag
  26. FileETag None
  27. </FilesMatch>
  28. # Compress svg
  29. AddOutputFilter DEFLATE svg