diff options
author | Reyk Floeter <reyk@esdenera.com> | 2014-07-13 16:12:59 +0200 |
---|---|---|
committer | Reyk Floeter <reyk@esdenera.com> | 2014-07-13 16:12:59 +0200 |
commit | b0a1cfbe755d14e21af5e866fc7321cf6a3c8d0b (patch) | |
tree | 948585fe33752889c039c67cc1eccd73ec5fa5c8 /httpd.conf.5 | |
parent | 660b4faa8d41d0817c59d00f8d606daab3586535 (diff) | |
download | httpd-b0a1cfbe755d14e21af5e866fc7321cf6a3c8d0b.tar.gz httpd-b0a1cfbe755d14e21af5e866fc7321cf6a3c8d0b.zip |
Implement media type support
Diffstat (limited to 'httpd.conf.5')
-rw-r--r-- | httpd.conf.5 | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/httpd.conf.5 b/httpd.conf.5 index a2c0cc4..2e99949 100644 --- a/httpd.conf.5 +++ b/httpd.conf.5 @@ -26,7 +26,7 @@ is the configuration file for the HTTP daemon, .Xr httpd 8 . .Sh SECTIONS .Nm -is divided into three main sections: +is divided into four main sections: .Bl -tag -width xxxx .It Sy Macros User-defined variables may be defined and used later, simplifying the @@ -36,6 +36,8 @@ Global settings for .Xr httpd 8 . .It Sy Servers Listening HTTP web servers. +.It Sy Types +Media types and extensions. .El .Pp Within the sections, @@ -114,6 +116,73 @@ The following general table options are available: .It Ic listen on Ar address Ic port Ar number Set the listen address and port. .El +.Sh TYPES +Configure the supported media types. +.Nm httpd +will set the +.Ar Content-Type +of the response header based on the file extension that is listed in the +.Ic types +section. +If not specified, +.Nm httpd +will use built-in media types for +.Ar text/css , +.Ar text/html , +.Ar text/plain , +.Ar image/gif , +.Ar image/png , +.Ar image/jpeg , +and +.Ar application/javascript . +.Pp +The +.Ic types +section must include one or more lines of the following syntax: +.Bl -tag -width Ds +.It Ar type/subtype Ar name Oo Ar name ... Oc Ic ; +Set the media +.Ar type +and +.Ar subtype +to the specified extension +.Ar name . +One or more names can be specified per line. +.El +.Sh EAMPLES +The following example will start two pre-forked servers that are +listening on the primary IP address of the network interface that is a +member of the +.Ar egress +group. +It additionally defines some media types overriding the defaults. +.Bd -literal -offset indent +prefork 2 + +server "default" { + listen on egress port 80 +} + +types { + text/css css; + text/html html html; + text/txt txt; + image/gif gif; + image/jpeg jpg jpeg; + image/png png; + application/javascript js; + application/xml xml; +} +.Ed +.Pp +The syntax of the types section is compatible to the format that is used by +.Xr nginx 8 , +so you can optionally include its +.Pa mime.types +file directly: +.Bd -literal -offset indent +include "/etc/nginx/mime.types" +.Ed .Sh SEE ALSO .Xr httpd 8 . .Sh AUTHORS |