Derek Merck
derek_merck@brown.edu
Rhode Island Hospital and Brown University
Providence, RI
Configure and run a Nginx web server with reverse proxying in a Docker container.
- geerlingguy.docker to setup the docker environment
- geerlingguy.pip to install Python reqs
Always uses the official Nginx image.
Set the Nginx version tag.
nginx_docker_image_tag: "latest"
Always runs on ports 80 and 443 (if secured)
nginx_container_name: "nginx"
nginx_config_dir: "/opt/{{ nginx_container_name }}"
See examples for format of upstream reverse proxies and security.
nginx_upstreams: []
nginx_security: {}
- hosts: web_server
roles:
- role: derekmerck.nginx_docker
nginx_upstreams:
- name: upstream
path: /my_path # No trailing slash, rewrite host -> host/my_path
pool:
- port: 5000
# host defaults to "localhost"
- host: another_host
port: 80
nginx_security:
cert_dir: "/opt/certs"
common_name: "www.example.com"
MIT