Nginx 教程

主要文档

Nginx功能概述 为什么选择Nginx Nginx安装 常见问题(FAQ) 配置符号参考 调试 nginx 优化 Nginx 运行和控制Nginx

核心模块

Nginx事件模块 Nginx主模块

基本模块

Browser模块 Charset模块 Geo模块 HttpAccess模块 HttpAuthBasic模块 HttpAutoindex模块 HttpEmptyGif模块 HttpFcgi模块 HttpGzip模块 HttpHeaders模块 HttpIndex模块 HttpIndex模块. HttpLimit zone HttpLimitReqest模块 HttpLog模块 HttpProxy模块 HttpRewrite模块 HttpSSI模块 HttpUserId http核心模块 map Memcached

其他模块

Addition模块 EmbeddedPerl flv GooglePerftools HttpDav模块 HttpGeoIP HttpGzipStatic HttpImageFilter HttpRealIp HttpSecureLink HttpSSL HttpSubstitution HttpXSLT RandomIndex StubStatus模块

mail模块

MailAuth MailCore MailProxy MailSSL

安装

nginx php-fpm安装配置 nginx在fedora上的安装 nginx在freebsd上的安装 nginx在ubuntu上的安装 nginx在windows上的安装

配置示例和方法

HWLoadbalancerCheckErrors nginx防盗链 负载均衡 完整例子 完整例子2 虚拟主机

HttpXSLT


This module is a filter which converts an XML response with the aid of one or more XSLT templates.

This module was introduced in 0.7.8 and needs to be enabled via

./configure --with-http_xslt_module 

Example:

location / {
  xml_entities       /site/dtd/entities.dtd;
  xslt_stylesheet    /site/xslt/one.xslt   param=value;
  xslt_stylesheet    /site/xslt/two.xslt;

} 

指令

xslt_entities

syntax:*xml_entities *

default:*no*

context:*http, server, location*

Specifies the DTD file which describes symbolic elements (xml entities). This file is compiled at the stage of configuration. For technical reasons it's not possible to specify entities in the XML being processed, therefore they are ignored, but this specially assigned file is used instead. In this file it is not necessary to describe structure of processed XML, it is sufficient only to declare necessary symbolic elements, for example:

 

xslt_stylesheet

syntax:*xslt_stylesheet template [parameter[[ parameter... ]] default:no*

context:*http, server, location*

Specifies the XSLT template with its parameters. Template is compiled at the stage of configuration. The parameters are assigned as shown:

 param=value 

You can specify parameters either one per line, or separate multiple parameters with colon (“: ”) If the parameter itself contains the character “:”, escape it as “%3A”. Furthermore, libxslt requires that string parameters should be quoted by the single or dual quotation marks if they contain non-alphanumeric characters, for example:

 param1='http%3A//www.example.com': param2=value2 

It's possible to use variables as parameters, for example, the entire line of the parameters can be substituted with one variable:

 location / {
    xslt_stylesheet /site/xslt/one.xslt
    $arg_xslt_params

    param1='$value1': param2=value2
    param3=value3;
  } 

It is possible to specify several templates, in which case they would be chained together in the order of their declaration.

xslt_types

syntax:*xslt_types mime-type [mime-type...]*

default:*xslt_types text/xml*

context:*http, server, location*

Permit processing responses with specified MIME-types in addition to “text/xml”. If XSLT output mode is HTML, then the response MIME-type changes to “text/HTML”.