lighttpd 设置http头

Conditional Request Headers

Module: mod_setenv

Description

The setenv module allows influencing the environment external applications are spawned in and the response headers the server sends to the clients.

Automatic Decompression

If you have a lot text-files compressed with gzip on disk and want that the browser is decompressing them on retrival you can use setenv to inject the Content-Encoding header:

  $HTTP["url"] =~ "(README|ChangeLog|\.txt)\.gz$" {
    setenv.add-response-header  = ( "Content-Encoding" => "gzip")
    mimetype.assign = ("" => "text/plain" )
  }

Options

setenv.add-environment
Adds a value to the process environment (aka environment variables) that is passed to the external applications:

    setenv.add-environment = ( 
      "TRAC_ENV" => "lighttpd",
      "RAILS_ENV" => "production" 
    )

setenv.add-response-header
Adds a header to the HTTP response sent to the client:

    setenv.add-response-header = (
      "Content-Encoding" => "gzip" 
    )

setenv.add-request-header
Adds a header to the HTTP request that was received from the client ::

    setenv.add-request-header = (
      "X-Proxy" => server.name
    )


http://redmine.lighttpd.net/projects/1/wiki/Docs_ModSetEnv


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当然,我可以帮你提供一些关于 lighttpd 的教程。lighttpd 是一个轻量级、快速的 Web 服务器,适用于处理高并发的静态和动态内容。以下是一个简单的 lighttpd 教程,帮助你入门: 1. 安装 lighttpd: - 在 Ubuntu 上,可以使用以下命令进行安装:`sudo apt-get install lighttpd` - 在 CentOS 上,可以使用以下命令进行安装:`sudo yum install lighttpd` 2. 配置 lighttpd: - 主要的配置文件是 `/etc/lighttpd/lighttpd.conf`,你可以使用编辑器打开该文件。 - 配置文件中的一些重要选项包括服务器端口、文档根目录、访问日志等。 - 你可以根据自己的需求进行配置,确保服务器能够工作正常。 3. 启动 lighttpd: - 在 Ubuntu 上,可以使用以下命令启动 lighttpd:`sudo service lighttpd start` - 在 CentOS 上,可以使用以下命令启动 lighttpd:`sudo systemctl start lighttpd` 4. 创建网站: - 默认情况下,lighttpd 的文档根目录位于 `/var/www/html`。 - 在该目录下创建一个简单的 HTML 文件,作为你的网站首页。 5. 测试网站: - 打开你的浏览器,输入服务器的 IP 地址或域名。 - 如果一切正常,你应该能够看到你创建的网站首页。 这只是一个简单的入门教程,帮助你开始使用 lighttpd。你可以进一步学习 lighttpd 的高级功能,例如虚拟主机配置、SSL/TLS 支持等。希望对你有所帮助!如果有任何问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值