• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

NEWSH A D21-Jun-2007120 84

READMEH A D21-Jun-20072 KiB7651

configH A D03-May-2022168 95

ngx_http_notice_module.cH A D03-May-20226.4 KiB229137

README

1Greetings!
2
3This is the README for nginx-notice version 2.
4
5______________________________________________________________________
6About
7
8Nginx-notice is an nginx module designed to display notices of downtime,
9ignoring the usual semantics of HTTP methods GET, PUT, and POST, and returning
10a fixed response body for every request. It was originally written for the
11Causes on Facebook application, since every Facebook request is a POST
12(regardless of the intended effects, if any, on server state).
13
14______________________________________________________________________
15Installation
16
17To compile this module, you must recompile nginx itself. Once you are
18comfortable with configuring and compiling nginx, you can use this module by
19adding "--add-module=/path/to/this/directory" to your configure options.
20
21For example, to compile nginx with the default options plus this module, you
22could type:
23
24 $ ./configure --add-module=/path/to/this/directory
25
26Then compile and install nginx as you normally would.
27
28______________________________________________________________________
29Configuration
30
31Once the module is installed, you will have two new configuration directives.
32
33Example:
34
35  server {
36    if (-f /path/to/notice.txt) {
37      rewrite ^(.*)$ /notice.txt;
38      break;
39    }
40
41    location = /notice.txt {
42      notice /path/to/notice.txt;
43      notice_type text/plain;
44      break;
45    }
46  }
47
48For the "notice" directive:
49
50  * syntax: notice path
51  * default: None
52  * context: location
53
54  Enables display of the maintenance notice for this location.
55
56For the "notice_type" directive:
57
58  * syntax: notice_type type
59  * default: text/html
60  * context: location
61
62  Sets the content-type of the notice for this location.
63
64______________________________________________________________________
65Bugs
66
67  * There is a hard limit on the size of the notice that this module will send,
68    by default 100KiB. You can change this by editing the source file.
69  * This module does not log errors.
70
71______________________________________________________________________
72
73That's all. Have fun!
74
75kr
76