1
0
forked from finallycoffee/base
finallycoffee.base/roles/nginx
2024-02-06 11:05:13 +01:00
..
defaults update(nginx): bump version to 1.25.3 2024-02-06 11:05:13 +01:00
handlers feat(nginx): add role migrated from finallycoffee.services 2023-07-26 19:39:14 +02:00
tasks feat(nginx): add role migrated from finallycoffee.services 2023-07-26 19:39:14 +02:00
README.md feat(nginx): add role migrated from finallycoffee.services 2023-07-26 19:39:14 +02:00

finallycoffee.services.nginx ansible role

Description

Runs nginx, a HTTP reverse proxy, in a docker container.

Usage

For the role to do anything, nginx_config needs to be populated with the configuration for nginx. An example would be:

nginx_config: |+
  server {
    listen 80 default_server;
    server_name my.server.fqdn;
    location / { return 200; }
  }  

The container is named nginx by default, this can be overridden in nginx_container_name. When running this role multiple times, nginx_base_path should also be changed for each run, otherwise the configuration files collide in the filesystem.

For exposing this server to the host and/or internet, the nginx_container_ports (port forwarding host from host to container), nginx_container_networks (docker networking) or nginx_container_labels (for label-based routing discovery like traefik) can be used. The options correspond to the arguments of the community.docker.docker_container module.