diff options
author | Badlop <badlop@process-one.net> | 2009-07-21 17:31:09 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2009-07-21 17:31:09 +0000 |
commit | 5346a7df024cabddf251174ad0c04b667e715ffe (patch) | |
tree | 7bc98d1da0d39ec90bce43a6a2c7bcb063da4d8c /doc | |
parent | fix get_entity_subscriptions result match (diff) |
Allow content types to be configured in ejabberd.cfg (EJAB-975)(thanks to Brian Cully)
SVN Revision: 2376
Diffstat (limited to 'doc')
-rw-r--r-- | doc/guide.html | 19 | ||||
-rw-r--r-- | doc/guide.tex | 19 |
2 files changed, 34 insertions, 4 deletions
diff --git a/doc/guide.html b/doc/guide.html index 2d1fb8ea..13e104e9 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -2111,17 +2111,32 @@ Indicate one or more directory index files, similarly to Apache’s DirectoryIndex variable. When a web request hits a directory instead of a regular file, those directory indices are looked in order, and the first one found is returned. +</DD><DT CLASS="dt-description"><B><TT>content_types</TT></B></DT><DD CLASS="dd-description"> +Specify a mapping of extensions to content types. +There are several content types already defined, +with this option you can add new definitions, modify or delete existing ones. +To delete an existing definition, simply define it with a value: ‘undefined’. +</DD><DT CLASS="dt-description"><B><TT>default_content_type</TT></B></DT><DD CLASS="dd-description"> +Specify the content type to use for unknown extensions. +Default value is ‘application/octet-stream’. </DD></DL><P>This example configuration will serve the files from the local directory <CODE>/var/www</CODE> in the address <CODE>http://example.org:5280/pub/archive/</CODE>. +In this example a new content type <TT>ogg</TT> is defined, +<TT>png</TT> is redefined, and <TT>jpg</TT> definition is deleted. To use this module you must enable it: </P><PRE CLASS="verbatim">{modules, [ ... {mod_http_fileserver, [ {docroot, "/var/www"}, - {directory_indices, ["index.html", "main.htm"]}, - {accesslog, "/var/log/ejabberd/access.log"} + {accesslog, "/var/log/ejabberd/access.log"}, + {directory_indices, ["index.html", "main.htm"]}, + {content_types, [{".ogg", "audio/ogg"}, + {".png", "image/png"}, + {".jpg", undefined} + ]}, + {default_content_type, "text/html"} ] }, ... diff --git a/doc/guide.tex b/doc/guide.tex index 7c8466ee..ffbc2418 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -2788,11 +2788,21 @@ Options: DirectoryIndex variable. When a web request hits a directory instead of a regular file, those directory indices are looked in order, and the first one found is returned. + \titem{content\_types} \ind{options!contenttypes} + Specify a mapping of extensions to content types. + There are several content types already defined, + with this option you can add new definitions, modify or delete existing ones. + To delete an existing definition, simply define it with a value: `undefined'. + \titem{default\_content\_type} \ind{options!defaultcontenttype} + Specify the content type to use for unknown extensions. + Default value is `application/octet-stream'. \end{description} This example configuration will serve the files from the local directory \verb|/var/www| in the address \verb|http://example.org:5280/pub/archive/|. +In this example a new content type \term{ogg} is defined, +\term{png} is redefined, and \term{jpg} definition is deleted. To use this module you must enable it: \begin{verbatim} {modules, @@ -2800,8 +2810,13 @@ To use this module you must enable it: ... {mod_http_fileserver, [ {docroot, "/var/www"}, - {directory_indices, ["index.html", "main.htm"]}, - {accesslog, "/var/log/ejabberd/access.log"} + {accesslog, "/var/log/ejabberd/access.log"}, + {directory_indices, ["index.html", "main.htm"]}, + {content_types, [{".ogg", "audio/ogg"}, + {".png", "image/png"}, + {".jpg", undefined} + ]}, + {default_content_type, "text/html"} ] }, ... |