Skip to content

czerasz/nginx-configuration-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nginx Configuration Example

Features

  • Maintenance Mode

    When the file /usr/share/nginx/html/maintenance-mode exists Nginx will return the content of /usr/share/nginx/html/maintenance.html together with the status code 503 (service temporarily unavailable).

    The maintenance mode can be enabled through the following HTTP request:

      curl -XPUT -u czerasz:password1234567890 localhost/maintenance-mode -d ''
    

    The maintenance mode can be disabled with the following HTTP request:

      curl -XDELETE -u czerasz:password1234567890 localhost/maintenance-mode
    

Test

To test the configuration run the following helper script:

./bin/test.sh

This script is runs test based on bats inside the container.

Usefull Commands

  • reload Nginx

      kill -HUP `cat /var/run/nginx.pid`
    
  • generate the /etc/nginx/htpasswd file with base auth credentials

      htpasswd -cb /etc/nginx/htpasswd 'czerasz' 'password1234567890'
    

Requirements

Resources

About

Examples of cool Nginx Configurations

Resources

Stars

Watchers

Forks

Packages

No packages published