Skip to content

Commit 34dbedf

Browse files
authored
Merge pull request #2110 from LeoColomb/patch-1
Bump apache-server-configs to v3.1.0
2 parents 2c4c508 + 81537a3 commit 34dbedf

File tree

2 files changed

+83
-37
lines changed

2 files changed

+83
-37
lines changed

dist/.htaccess

+82-36
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Apache Server Configs v3.0.0 | MIT License
1+
# Apache Server Configs v3.1.0 | MIT License
22
# https://github.com/h5bp/server-configs-apache
33

44
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
@@ -48,6 +48,8 @@
4848
# ----------------------------------------------------------------------
4949

5050
# Allow cross-origin access to web fonts.
51+
#
52+
# https://developers.google.com/fonts/docs/troubleshooting
5153

5254
<IfModule mod_headers.c>
5355
<FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
@@ -66,8 +68,9 @@
6668
# some of the attributes of the `PerformanceResourceTiming` object will
6769
# be set to zero.
6870
#
71+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin
6972
# https://www.w3.org/TR/resource-timing/
70-
# http://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/
73+
# https://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/
7174

7275
# <IfModule mod_headers.c>
7376
# Header set Timing-Allow-Origin: "*"
@@ -82,6 +85,7 @@
8285
# ----------------------------------------------------------------------
8386

8487
# Customize what Apache returns to the client in case of an error.
88+
#
8589
# https://httpd.apache.org/docs/current/mod/core.html#errordocument
8690

8791
ErrorDocument 404 /404.html
@@ -119,13 +123,14 @@ Options -MultiViews
119123
#
120124
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
121125
# https://blogs.msdn.microsoft.com/ie/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11/
126+
# https://msdn.microsoft.com/en-us/library/ff955275.aspx
122127

123128
<IfModule mod_headers.c>
124129

125130
Header set X-UA-Compatible "IE=edge"
126131

127132
# `mod_headers` cannot match based on the content-type, however,
128-
# the `X-UA-Compatible` response header should be send only for
133+
# the `X-UA-Compatible` response header should be sent only for
129134
# HTML documents and not for the other resources.
130135

131136
<FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
@@ -134,19 +139,6 @@ Options -MultiViews
134139

135140
</IfModule>
136141

137-
# ----------------------------------------------------------------------
138-
# | Iframes cookies |
139-
# ----------------------------------------------------------------------
140-
141-
# Allow cookies to be set from iframes in Internet Explorer.
142-
#
143-
# https://msdn.microsoft.com/en-us/library/ms537343.aspx
144-
# https://www.w3.org/TR/2000/CR-P3P-20001215/
145-
146-
# <IfModule mod_headers.c>
147-
# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
148-
# </IfModule>
149-
150142
# ######################################################################
151143
# # MEDIA TYPES AND CHARACTER ENCODINGS #
152144
# ######################################################################
@@ -346,11 +338,24 @@ AddDefaultCharset utf-8
346338
# ----------------------------------------------------------------------
347339

348340
# Redirect from the `http://` to the `https://` version of the URL.
341+
#
349342
# https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
350343

344+
# (1) If you're using cPanel AutoSSL or the Let's Encrypt webroot
345+
# method it will fail to validate the certificate if validation
346+
# requests are redirected to HTTPS. Turn on the condition(s)
347+
# you need.
348+
#
349+
# https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml
350+
# https://tools.ietf.org/html/draft-ietf-acme-acme-12
351+
351352
# <IfModule mod_rewrite.c>
352353
# RewriteEngine On
353354
# RewriteCond %{HTTPS} !=on
355+
# # (1)
356+
# # RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
357+
# # RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[\w-]+$
358+
# # RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
354359
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
355360
# </IfModule>
356361

@@ -368,7 +373,7 @@ AddDefaultCharset utf-8
368373
#
369374
# (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
370375

371-
# (1) The rule assume by default that both HTTP and HTTPS
376+
# (1) The rule assumes by default that both HTTP and HTTPS
372377
# environments are available for redirection.
373378
# If your SSL certificate could not handle one of the domains
374379
# used during redirection, you should turn the condition on.
@@ -397,7 +402,7 @@ AddDefaultCharset utf-8
397402
#
398403
# (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
399404

400-
# (1) The rule assume by default that both HTTP and HTTPS
405+
# (1) The rule assumes by default that both HTTP and HTTPS
401406
# environments are available for redirection.
402407
# If your SSL certificate could not handle one of the domains
403408
# used during redirection, you should turn the condition on.
@@ -451,6 +456,7 @@ AddDefaultCharset utf-8
451456
# against more than just clickjacking attacks:
452457
# https://cure53.de/xfo-clickjacking.pdf.
453458
#
459+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
454460
# https://tools.ietf.org/html/rfc7034
455461
# https://blogs.msdn.microsoft.com/ieinternals/2010/03/30/combating-clickjacking-with-x-frame-options/
456462
# https://www.owasp.org/index.php/Clickjacking
@@ -460,7 +466,7 @@ AddDefaultCharset utf-8
460466
# Header set X-Frame-Options "DENY"
461467

462468
# # `mod_headers` cannot match based on the content-type, however,
463-
# # the `X-Frame-Options` response header should be send only for
469+
# # the `X-Frame-Options` response header should be sent only for
464470
# # HTML documents and not for the other resources.
465471

466472
# <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
@@ -484,18 +490,19 @@ AddDefaultCharset utf-8
484490
# That almost certainly won't work as-is for your website!
485491
#
486492
# To make things easier, you can use an online CSP header generator
487-
# such as: http://cspisawesome.com/.
493+
# such as: https://www.cspisawesome.com/.
488494
#
495+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
496+
# https://www.w3.org/TR/CSP3/
489497
# https://content-security-policy.com/
490498
# https://www.html5rocks.com/en/tutorials/security/content-security-policy/
491-
# https://w3c.github.io/webappsec-csp/
492499

493500
# <IfModule mod_headers.c>
494501

495502
# Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
496503

497504
# # `mod_headers` cannot match based on the content-type, however,
498-
# # the `Content-Security-Policy` response header should be send
505+
# # the `Content-Security-Policy` response header should be sent
499506
# # only for HTML documents and not for the other resources.
500507

501508
# <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
@@ -598,12 +605,14 @@ AddDefaultCharset utf-8
598605
# which can be done with either `env=https` or `"expr=%{HTTPS} == 'on'"` (4). The
599606
# exact way depends on your environment and might just be tried.
600607
#
601-
# https://www.html5rocks.com/en/tutorials/security/transport-layer-security/
602-
# https://tools.ietf.org/html/rfc6797#section-6.1
603-
# https://blogs.msdn.microsoft.com/ieinternals/2014/08/18/strict-transport-security/
604608
# (2) https://hstspreload.org/
605609
# (3) https://tools.ietf.org/html/rfc6797#section-7.2
606610
# (4) https://stackoverflow.com/questions/24144552/how-to-set-hsts-header-from-htaccess-only-on-https/24145033#comment81632711_24145033
611+
#
612+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
613+
# https://tools.ietf.org/html/rfc6797#section-6.1
614+
# https://www.html5rocks.com/en/tutorials/security/transport-layer-security/
615+
# https://blogs.msdn.microsoft.com/ieinternals/2014/08/18/strict-transport-security/
607616

608617
# <IfModule mod_headers.c>
609618
# Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains"
@@ -624,9 +633,8 @@ AddDefaultCharset utf-8
624633
# is serving user-uploaded content or content that could potentially be
625634
# treated as executable by the browser.
626635
#
627-
# https://www.slideshare.net/hasegawayosuke/owasp-hasegawa
636+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
628637
# https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-v-comprehensive-protection/
629-
# https://msdn.microsoft.com/en-us/library/ie/gg622941.aspx
630638
# https://mimesniff.spec.whatwg.org/
631639

632640
<IfModule mod_headers.c>
@@ -665,6 +673,7 @@ AddDefaultCharset utf-8
665673
# you are taking all possible measures to prevent XSS attacks, the
666674
# most obvious being: validating and sanitizing your website's inputs.
667675
#
676+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
668677
# https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-iv-the-xss-filter/
669678
# https://blogs.msdn.microsoft.com/ieinternals/2011/01/31/controlling-the-xss-filter/
670679
# https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29
@@ -675,7 +684,7 @@ AddDefaultCharset utf-8
675684
# Header set X-XSS-Protection "1; mode=block"
676685

677686
# # `mod_headers` cannot match based on the content-type, however,
678-
# # the `X-XSS-Protection` response header should be send only for
687+
# # the `X-XSS-Protection` response header should be sent only for
679688
# # HTML documents and not for the other resources.
680689

681690
# <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
@@ -712,7 +721,7 @@ AddDefaultCharset utf-8
712721
# Header set Referrer-Policy "no-referrer-when-downgrade"
713722

714723
# # `mod_headers` cannot match based on the content-type, however,
715-
# # the `Referrer-Policy` response header should be send
724+
# # the `Referrer-Policy` response header should be sent
716725
# # only for HTML documents and not for the other resources.
717726

718727
# <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
@@ -721,6 +730,29 @@ AddDefaultCharset utf-8
721730

722731
# </IfModule>
723732

733+
# ----------------------------------------------------------------------
734+
# | Disable TRACE HTTP Method |
735+
# ----------------------------------------------------------------------
736+
737+
# Prevent Apache from responding to `TRACE` HTTP request.
738+
#
739+
# The TRACE method, while apparently harmless, can be successfully
740+
# leveraged in some scenarios to steal legitimate users' credentials
741+
#
742+
# Modern browsers now prevent TRACE requests being made via JavaScript,
743+
# however, other ways of sending TRACE requests with browsers have been
744+
# discovered, such as using Java.
745+
#
746+
# (!) The `TraceEnable` directive will only work in the main server
747+
# configuration file, so don't try to enable it in the `.htaccess` file!
748+
#
749+
# https://tools.ietf.org/html/rfc7231#section-4.3.8
750+
# https://www.owasp.org/index.php/Cross_Site_Tracing
751+
# https://www.owasp.org/index.php/Test_HTTP_Methods_(OTG-CONFIG-006)
752+
# https://httpd.apache.org/docs/current/mod/core.html#traceenable
753+
754+
# TraceEnable Off
755+
724756
# ----------------------------------------------------------------------
725757
# | Server-side technology information |
726758
# ----------------------------------------------------------------------
@@ -768,7 +800,7 @@ ServerSignature Off
768800
#
769801
# https://httpd.apache.org/docs/current/mod/core.html#servertokens
770802

771-
#ServerTokens Prod
803+
# ServerTokens Prod
772804

773805
# ######################################################################
774806
# # WEB PERFORMANCE #
@@ -781,7 +813,9 @@ ServerSignature Off
781813
<IfModule mod_deflate.c>
782814

783815
# Force compression for mangled `Accept-Encoding` request headers
784-
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html
816+
#
817+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
818+
# https://calendar.perfplanet.com/2010/pushing-beyond-gzipping/
785819

786820
<IfModule mod_setenvif.c>
787821
<IfModule mod_headers.c>
@@ -793,6 +827,7 @@ ServerSignature Off
793827
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
794828

795829
# Compress all output labeled with one of the following media types.
830+
#
796831
# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
797832

798833
<IfModule mod_filter.c>
@@ -850,6 +885,7 @@ ServerSignature Off
850885
# the response, and thus, wouldn't be able to understand the
851886
# content.
852887
#
888+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
853889
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding
854890

855891
<IfModule mod_mime.c>
@@ -869,6 +905,10 @@ ServerSignature Off
869905
# files by your own. Enabling this part will not auto-generate
870906
# brotlied files.
871907
#
908+
# Note that some clients (eg. browsers) require a secure connection
909+
# to request brotli-compressed resources.
910+
# https://www.chromestatus.com/feature/5420797577396224
911+
#
872912
# https://httpd.apache.org/docs/current/mod/mod_brotli.html#precompressed
873913

874914
# <IfModule mod_headers.c>
@@ -977,6 +1017,7 @@ ServerSignature Off
9771017
# used by mobile network providers) from modifying the website's
9781018
# content.
9791019
#
1020+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
9801021
# https://tools.ietf.org/html/rfc2616#section-14.9.5
9811022
#
9821023
# (!) If you are using `mod_pagespeed`, please note that setting
@@ -997,6 +1038,7 @@ ServerSignature Off
9971038

9981039
# Remove `ETags` as resources are sent with far-future expires headers.
9991040
#
1041+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
10001042
# https://developer.yahoo.com/performance/rules.html#etags
10011043
# https://tools.ietf.org/html/rfc7232#section-2.3
10021044

@@ -1008,15 +1050,17 @@ ServerSignature Off
10081050
FileETag None
10091051

10101052
# ----------------------------------------------------------------------
1011-
# | Expires headers |
1053+
# | Cache expiration |
10121054
# ----------------------------------------------------------------------
10131055

1014-
# Serve resources with far-future expires headers.
1056+
# Serve resources with far-future expiration date.
10151057
#
10161058
# (!) If you don't control versioning with filename-based
10171059
# cache busting, you should consider lowering the cache times
10181060
# to something like one week.
10191061
#
1062+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
1063+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires
10201064
# https://httpd.apache.org/docs/current/mod/mod_expires.html
10211065

10221066
<IfModule mod_expires.c>
@@ -1143,18 +1187,21 @@ FileETag None
11431187
# specified files.
11441188

11451189
# <IfModule mod_include.c>
1190+
11461191
# <FilesMatch "\.combined\.js$">
11471192
# Options +Includes
11481193
# AddOutputFilterByType INCLUDES application/javascript \
11491194
# application/x-javascript \
11501195
# text/javascript
11511196
# SetOutputFilter INCLUDES
11521197
# </FilesMatch>
1198+
11531199
# <FilesMatch "\.combined\.css$">
11541200
# Options +Includes
11551201
# AddOutputFilterByType INCLUDES text/css
11561202
# SetOutputFilter INCLUDES
11571203
# </FilesMatch>
1204+
11581205
# </IfModule>
11591206

11601207
# ----------------------------------------------------------------------
@@ -1167,11 +1214,10 @@ FileETag None
11671214
#
11681215
# To understand why this is important and even a better solution than
11691216
# using something like `*.css?v231`, please see:
1170-
# http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
1217+
# https://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
11711218

11721219
# <IfModule mod_rewrite.c>
11731220
# RewriteEngine On
11741221
# RewriteCond %{REQUEST_FILENAME} !-f
1175-
# RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|m?js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
1222+
# RewriteRule ^(.+)\.(\w+)\.(bmp|css|cur|gif|ico|jpe?g|m?js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
11761223
# </IfModule>
1177-

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"devDependencies": {
3-
"apache-server-configs": "^3.0.0",
3+
"apache-server-configs": "^3.1.0",
44
"archiver": "^3.0.0",
55
"babel-core": "^6.26.3",
66
"babel-preset-env": "^1.7.0",

0 commit comments

Comments
 (0)