• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • mod_asis

    描述:发送包含自己的HTTP标头的文件
    状态:基础
    模块标识符: asis_module
    源文件: mod_asis.c

    摘要

    此模块提供处理程序send-as-is,它使Apache HTTP Server发送文档而不添加大多数常用的HTTP标头。

    这可用于从服务器发送任何类型的数据,包括重定向和其他特殊的HTTP响应,而无需cgi-script或nph脚本。

    由于历史原因,此模块可以使用mime类型httpd/send-as-is处理任何文件。

    用法

    在服务器配置文件中,将文件与send-as-is处理程序相关联。

    AddHandler send-as-is asis
    

    具有.asis扩展名的任何文件的内容将由Apache httpd发送到客户端,几乎没有任何更改。特别是,HTTP标头是根据mod_cgi规则从文件本身派生的,因此asis文件必须包含有效的标头,并且还可以使用CGI Status:头来确定HTTP响应代码。将自动插入Content-Length:标头,如果包含,则由httpd更正。

    这是一个文件的示例,其内容按原样发送,杀死告诉客户端文件已更改。

    Status: 301 Now where did I leave that URL Location: http://xyz.example.com/foo/bar.html Content-type: text/html <html><head><title>Lame excuses'R'us</title></head><body><h1>Fred's exceptionally wonderful page has moved to <a href="http://xyz.example.com/foo/bar.html">Joe's</a> site.</h1></body></html>

    笔记:

    服务器总是向返回到客户端的数据添加Date:Server:标头,因此这些标题标题包含在文件中。服务器不添加Last-Modified标头;它可能应该。


    上篇:mod_allowmethods

    下篇:mod_auth_basic