marcusianlevine.nginx-container
#nginx-container
Adds an nginx service to your Ansible Container project. Run the following commands to install the service:
# Set the working directory to your Ansible Container project root
$ cd myproject
# Install the service
$ ansible-container install ansible.nginx-container
Requirements
- Ansible Container
 - An existing Ansible Container project. To create a project, simply run the following:
# Create an empty project directory $ mkdir myproject # Set the working directory to the new directory $ cd myproject # Initialize the project $ ansible-contiainer init 
Role Variables
STATIC_ROOT: /static
Path to static content to be served by nginx.
STATIC_LOCATION: {{ STATIC_ROOT }}/
Requests which match this pattern will be aliased to the {{ STATIC_ROOT }} directory. Usually "/static/" or "/assets/".
PIDFILE_DIR: /run/nginx
Path where nginx will store the current PID value.
ASSET_PATHS: []
List of paths from which static content will be copied. Content will be copied to {{ STATIC_ROOT }}.
NOTE paths must be valid within the Ansible build container. If you're copying source files, mount the source directory to the build container using --with-volumes.
PROXY: no
When using this role as part of the demo app, nginx needs to proxy the django service, in which case set this to 'yes'.
PROXY_PASS: ""
The address of the backend server accepting the proxied requests. For example:
http://django:8080
PROXY_LOCATION: ""
A string containing an optional modifier and a matching pattern. Requests that contain the matching pattern are forwarded to the PROXY_PASS address. For example,
~* /(api|static)will forward requests that start with/apior/static.
PROXY_CONNECT_TIMEOUT: 60
Set the
proxy_connect_timeoutwith this value in seconds. Per NGINX docs, cannot exceed 75s.
PROXY_SEND_TIMEOUT: 60
Set
proxy_send_timeoutwith this value in seconds.
PROXY_READ_TIMEOUT: 60
Set the
proxy_read_timeoutwith this value in seconds.
Optional
EXTRA_CONFIG
List of absolute paths to extra NGINX configuration templates to be placed in
/etc/nginx/conf.dFilenames must end in.conf.j2, but specify this list with just.conf!
Dependencies
None.
Contributing
For convenience, as you're working on changes to this role, you can test by using the following workflow:
# Commit your changes
$ git commit -m
# Push your changes 
$ git push 
# Set the working directory to tests
$ cd tests 
# Run a build that installs the role at the most recent commit 
$ ./build.sh
A couple of notes:
- You must 
git pushyour changes in order for the build to pick them up. - Modify build.sh to point to your fork of this role.
 - If all goes well, and the build succeeds, the container built from your latest commit will be running in the background.
 - The running container will publish port 8000:8000, so if you point a browser to http://localhost:8000, you should see the dfault nginx page .
 
License
Apache v2
Author Information
See AUTHORS for a list of contributors. Thanks everyone!
ansible-galaxy install marcusianlevine.nginx-container