mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 06:25:18 -04:00
Readd some apache config.
This commit is contained in:
parent
38daa4aa1f
commit
a790c34a24
2 changed files with 122 additions and 34 deletions
|
@ -1,10 +1,119 @@
|
||||||
|
## details here: https://github.com/h5bp/server-configs-apache
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## SECURITY ###################################################################
|
||||||
|
|
||||||
|
DirectoryIndex disabled
|
||||||
|
FileETag None
|
||||||
|
ServerSignature Off
|
||||||
|
|
||||||
|
# Apache < 2.3
|
||||||
|
<IfModule !mod_authz_core.c>
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
Satisfy All
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Apache ≥ 2.3
|
||||||
<IfModule mod_authz_core.c>
|
<IfModule mod_authz_core.c>
|
||||||
#Apache 2.4
|
|
||||||
Require all denied
|
Require all denied
|
||||||
</IfModule>
|
</IfModule>
|
||||||
<IfModule !mod_authz_core.c>
|
|
||||||
#Apache 2.2
|
<IfModule mod_headers.c>
|
||||||
Satisfy all
|
Header set X-Content-Type-Options "nosniff"
|
||||||
Order deny,allow
|
Header unset ETag
|
||||||
Deny from all
|
Header unset X-Powered-By
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_autoindex.c>
|
||||||
|
Options -Indexes
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## COMPAT #####################################################################
|
||||||
|
|
||||||
|
AddDefaultCharset utf-8
|
||||||
|
|
||||||
|
<IfModule mod_mime.c>
|
||||||
|
AddCharset utf-8 .css .html .js .json .php .svg
|
||||||
|
|
||||||
|
AddType application/json json map topojson
|
||||||
|
AddType application/javascript js
|
||||||
|
AddType audio/mp4 f4a f4b m4a
|
||||||
|
AddType audio/ogg oga ogg opus
|
||||||
|
AddType image/bmp bmp
|
||||||
|
AddType image/svg+xml svg svgz
|
||||||
|
AddType image/webp webp
|
||||||
|
AddType video/mp4 f4v f4p m4v mp4
|
||||||
|
AddType video/ogg ogv
|
||||||
|
AddType video/webm webm
|
||||||
|
AddType video/x-flv flv
|
||||||
|
AddType image/x-icon cur ico
|
||||||
|
AddType application/font-woff woff
|
||||||
|
AddType application/font-woff2 woff2
|
||||||
|
AddType application/vnd.ms-fontobject eot
|
||||||
|
AddType application/x-font-ttf ttc ttf
|
||||||
|
AddType font/opentype otf
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## SPEED ######################################################################
|
||||||
|
|
||||||
|
<IfModule mod_expires.c>
|
||||||
|
ExpiresActive on
|
||||||
|
ExpiresDefault "access plus 1 month"
|
||||||
|
|
||||||
|
ExpiresByType text/html "access plus 0 seconds"
|
||||||
|
ExpiresByType application/json "access plus 0 seconds"
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_deflate.c>
|
||||||
|
<IfModule mod_setenvif.c>
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
|
||||||
|
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
|
||||||
|
</IfModule>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_filter.c>
|
||||||
|
AddOutputFilterByType DEFLATE "application/atom+xml" \
|
||||||
|
"application/javascript" \
|
||||||
|
"application/json" \
|
||||||
|
"application/ld+json" \
|
||||||
|
"application/manifest+json" \
|
||||||
|
"application/rdf+xml" \
|
||||||
|
"application/rss+xml" \
|
||||||
|
"application/schema+json" \
|
||||||
|
"application/vnd.geo+json" \
|
||||||
|
"application/vnd.ms-fontobject" \
|
||||||
|
"application/x-font-ttf" \
|
||||||
|
"application/x-javascript" \
|
||||||
|
"application/x-web-app-manifest+json" \
|
||||||
|
"application/xhtml+xml" \
|
||||||
|
"application/xml" \
|
||||||
|
"font/eot" \
|
||||||
|
"font/opentype" \
|
||||||
|
"image/bmp" \
|
||||||
|
"image/svg+xml" \
|
||||||
|
"image/vnd.microsoft.icon" \
|
||||||
|
"image/x-icon" \
|
||||||
|
"text/cache-manifest" \
|
||||||
|
"text/css" \
|
||||||
|
"text/html" \
|
||||||
|
"text/javascript" \
|
||||||
|
"text/plain" \
|
||||||
|
"text/vcard" \
|
||||||
|
"text/vnd.rim.location.xloc" \
|
||||||
|
"text/vtt" \
|
||||||
|
"text/x-component" \
|
||||||
|
"text/x-cross-domain-policy" \
|
||||||
|
"text/xml"
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_mime.c>
|
||||||
|
AddEncoding gzip svgz
|
||||||
|
</IfModule>
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
|
@ -1,34 +1,13 @@
|
||||||
<IfModule mod_authz_core.c>
|
## make this folder accessible
|
||||||
#Apache 2.4
|
|
||||||
Require all granted
|
# Apache < 2.3
|
||||||
</IfModule>
|
|
||||||
<IfModule !mod_authz_core.c>
|
<IfModule !mod_authz_core.c>
|
||||||
#Apache 2.2
|
|
||||||
Satisfy all
|
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
Allow from all
|
Allow from all
|
||||||
|
Satisfy All
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
DirectoryIndex disabled
|
# Apache ≥ 2.3
|
||||||
|
<IfModule mod_authz_core.c>
|
||||||
<IfModule mod_autoindex.c>
|
Require all granted
|
||||||
Options -Indexes
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
AddDefaultCharset utf-8
|
|
||||||
|
|
||||||
<IfModule mod_mime.c>
|
|
||||||
AddCharset utf-8 .css .html .js .json .php .svg
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
<IfModule mod_expires.c>
|
|
||||||
ExpiresActive on
|
|
||||||
ExpiresDefault "access plus 1 month"
|
|
||||||
|
|
||||||
ExpiresByType text/html "access plus 0 seconds"
|
|
||||||
ExpiresByType application/json "access plus 0 seconds"
|
|
||||||
|
|
||||||
ExpiresByType text/css "access plus 1 week"
|
|
||||||
ExpiresByType application/javascript "access plus 1 week"
|
|
||||||
ExpiresByType image/x-icon "access plus 1 week"
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue