Ancient nginx plugin; probably not useful to anyone.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
NEWS
README
config
ngx_http_notice_module.c

README

Greetings!

This is the README for nginx-notice version 2.

______________________________________________________________________
About

Nginx-notice is an nginx module designed to display notices of downtime,
ignoring the usual semantics of HTTP methods GET, PUT, and POST, and returning
a fixed response body for every request. It was originally written for the
Causes on Facebook application, since every Facebook request is a POST
(regardless of the intended effects, if any, on server state).

______________________________________________________________________
Installation

To compile this module, you must recompile nginx itself. Once you are
comfortable with configuring and compiling nginx, you can use this module by
adding "--add-module=/path/to/this/directory" to your configure options.

For example, to compile nginx with the default options plus this module, you
could type:

 $ ./configure --add-module=/path/to/this/directory

Then compile and install nginx as you normally would.

______________________________________________________________________
Configuration

Once the module is installed, you will have two new configuration directives.

Example:

  server {
    if (-f /path/to/notice.txt) {
      rewrite ^(.*)$ /notice.txt;
      break;
    }

    location = /notice.txt {
      notice /path/to/notice.txt;
      notice_type text/plain;
      break;
    }
  }

For the "notice" directive:

  * syntax: notice path
  * default: None
  * context: location

  Enables display of the maintenance notice for this location.

For the "notice_type" directive:

  * syntax: notice_type type
  * default: text/html
  * context: location

  Sets the content-type of the notice for this location.

______________________________________________________________________
Bugs

  * There is a hard limit on the size of the notice that this module will send,
    by default 100KiB. You can change this by editing the source file.
  * This module does not log errors.

______________________________________________________________________

That's all. Have fun!

kr