Move MIME-type and charset declaration into their own conf files
This commit is contained in:
parent
452b630330
commit
2d135053cb
|
@ -0,0 +1,32 @@
|
|||
# ----------------------------------------------------------------------
|
||||
# | Character encodings |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Serve all resources labeled as `text/html` or `text/plain`
|
||||
# with the media type `charset` parameter set to `UTF-8`.
|
||||
#
|
||||
# https://nginx.org/en/docs/http/ngx_http_charset_module.html#charset
|
||||
|
||||
charset utf-8;
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Update charset_types to match updated mime.types.
|
||||
# text/html is always included by charset module.
|
||||
# Default: text/html text/xml text/plain text/vnd.wap.wml application/javascript application/rss+xml
|
||||
#
|
||||
# https://nginx.org/en/docs/http/ngx_http_charset_module.html#charset_types
|
||||
|
||||
charset_types
|
||||
text/css
|
||||
text/plain
|
||||
text/vnd.wap.wml
|
||||
text/javascript
|
||||
text/markdown
|
||||
text/calendar
|
||||
text/x-component
|
||||
text/vcard
|
||||
text/cache-manifest
|
||||
text/vtt
|
||||
application/json
|
||||
application/manifest+json;
|
|
@ -0,0 +1,18 @@
|
|||
# ----------------------------------------------------------------------
|
||||
# | Media types |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Serve resources with the proper media types (f.k.a. MIME types).
|
||||
#
|
||||
# https://www.iana.org/assignments/media-types/media-types.xhtml
|
||||
# https://nginx.org/en/docs/http/ngx_http_core_module.html#types
|
||||
|
||||
include mime.types;
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Default: text/plain
|
||||
#
|
||||
# https://nginx.org/en/docs/http/ngx_http_core_module.html#default_type
|
||||
|
||||
default_type application/octet-stream;
|
25
nginx.conf
25
nginx.conf
|
@ -51,29 +51,10 @@ http {
|
|||
include h5bp/security/server_software_information.conf;
|
||||
|
||||
# Specify MIME types for files.
|
||||
# https://nginx.org/en/docs/http/ngx_http_core_module.html#types
|
||||
include mime.types;
|
||||
include h5bp/media_types/media_types.conf;
|
||||
|
||||
# Default: text/plain
|
||||
# https://nginx.org/en/docs/http/ngx_http_core_module.html#default_type
|
||||
default_type application/octet-stream;
|
||||
|
||||
# Specify a charset
|
||||
# https://nginx.org/en/docs/http/ngx_http_charset_module.html#charset
|
||||
charset utf-8;
|
||||
|
||||
# Update charset_types to match updated mime.types.
|
||||
# text/html is always included by charset module.
|
||||
# Default: text/html text/xml text/plain text/vnd.wap.wml application/javascript application/rss+xml
|
||||
# https://nginx.org/en/docs/http/ngx_http_charset_module.html#charset_types
|
||||
charset_types
|
||||
text/css
|
||||
text/plain
|
||||
text/vnd.wap.wml
|
||||
text/javascript
|
||||
application/json
|
||||
application/rss+xml
|
||||
application/xml;
|
||||
# Set character encodings.
|
||||
include h5bp/media_types/character_encodings.conf;
|
||||
|
||||
# Include $http_x_forwarded_for within default format used in log files
|
||||
# https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
|
||||
|
|
Loading…
Reference in New Issue