Giter Site home page Giter Site logo

nginx-notice's Introduction

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

nginx-notice's People

Contributors

kr avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.