Code Monkey home page Code Monkey logo

stouts.nginx's Introduction

Stouts.nginx

Build Status

Ansible role which simple manage nginx

  • Install and upgrade;
  • Provide hanlers for restart and reload;
  • Support simple site configurations.

Variables

nginx_enabled: yes                  # The role in enabled
nginx_dir: /etc/nginx               # Nginx config directory
nginx_sites_dir: "{{nginx_dir}}/sites-enabled" # Nginx include directory
nginx_default_site: "{{nginx_sites_dir}}/default"
nginx_delete_default_site: no
nginx_user: www-data                # -------------------
nginx_worker_processes: 4           #   See nginx docs
nginx_worker_connections: 1024      # -------------------
nginx_sendfile: yes
nginx_keepalive_timeout: 65
nginx_gzip: yes
nginx_server_names_hash_bucket_size: 128
nginx_access_log: /var/log/nginx/access.log
nginx_error_log: /var/log/nginx/error.log
nginx_http_options:                 # Additional http options (each line will be added as is)
                                    # Ex: nginx_http_options:
                                    #       - auth_basic "You shall not pass!";
                                    #       - auth_basic_user_file {{nginx_auth_file}};

nginx_servers:                      # Setup servers (simplest interface, use cfg files for large configurations)
                                    # Ex: nginx_servers:
                                    #     -
                                    #       - listen 80;
                                    #       - server_name localhost;
                                    #       - location / { root html; index index.html; }
                                    #     -
                                    #       - listen 80;
                                    #       - server_name test.com;
                                    #       - location / { root /test; index index.html; }

nginx_auth_file: "{{nginx_dir}}/.htpasswd" # Where stored passwords
nginx_auth_users: []                # Setup users for http authentication
                                    # nginx_auth_users:
                                    #   - { name: team, password: secret }

Usage

Add Stouts.nginx to your roles and set vars in your playbook file.

Example:

- hosts: all

  roles:
    - Stouts.nginx

  vars:
    nginx_servers:
      - listen 80;
      - server_name google.com;
      - location / { root /var/www/google; index index.html; }

License

Licensed under the MIT License. See the LICENSE file for details.

Feedback, bug-reports, requests, ...

Are welcome!

stouts.nginx's People

Contributors

klen avatar jezdez avatar egorchakov avatar

Watchers

James Cloos avatar  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.