Mastering Nginx
NGINX for the Developer [ 164 ] The following table describes the directives available with the memcached module, which is compi ...
Chapter 7 [ 165 ] Caching in the filesystem Suppose your application writes prerendered pages as files. You know how long each f ...
NGINX for the Developer [ 166 ] Knowing what you do about the files your application generates, you can set these headers approp ...
Chapter 7 [ 167 ] To see how this configuration sets the headers, let's take a look at what each location looks like in the brow ...
NGINX for the Developer [ 168 ] An HTML file: The Expires header is set to 3 days later than the Date header. The Cache-Control ...
Chapter 7 [ 169 ] The addition module The addition module works as a filter to add text before and/or after a response. It is no ...
NGINX for the Developer [ 170 ] The sub module The sub module works as a filter to replace (substitute) one text for another. It ...
Chapter 7 [ 171 ] Since text/html is the default value, this type doesn't need to be added—it won't be overwritten by adding add ...
NGINX for the Developer [ 172 ] The directives included in the xslt module are summarized in the following table: Table: HTTP XS ...
Chapter 7 [ 173 ] The Server Side Includes commands supported by NGINX are shown in the following table. They all follow the fol ...
NGINX for the Developer [ 174 ] Command Argument Explanation expr The expression to be evaluated for truth: variable existence ...
Chapter 7 [ 175 ] An SSI file is nothing more than an HTML file with these commands embedded within comments. That way, if ssi i ...
NGINX for the Developer [ 176 ] Decision-making in NGINX You may find yourself trying to bend NGINX's configuration directives i ...
Chapter 7 [ 177 ] $r->header_in(header): The value of the specified request header. $r->header_only: Instructs NGINX to r ...
NGINX for the Developer [ 178 ] The first step is to define the processing actions in a Perl handler: # upstreammapper.pm # name ...
Chapter 7 [ 179 ] Then we set up NGINX to use this module to do the mapping: http { # this path is relative to the main configur ...
NGINX for the Developer [ 180 ] The secure_link module works by computing the MD5 hash of a link concatenated with a secret word ...
Chapter 7 [ 181 ] To ensure that links without a hash will not work, we can add an additional link to our HTML: <a href="/dow ...
NGINX for the Developer [ 182 ] Directive Explanation size: Emits information about an image in JSON format. rotate: Rotates an ...
Chapter 7 [ 183 ] Using these directives, we can construct an image resizing module as follows: location /img { try_files $uri / ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf