Home
ENG - Ansible Role Nginx
June 2024 (50 Words, 1 Minutes)
linux
debian
ansible
Simple ansible role to configure nginx on a remote machine.
This role can be founf there: github.com - stethewwolf/ansible-nginx-role
Introduction
This work shall be included into an ansible playbook as ansible role. This role is intented to manage containers running on a debian system.
In general this role allow to configure nginx:
- virtual hosts
- SSL certificates using certbot.
Installed packages
This role will install following packages:
nginx
certbot
Configurations
Ports
Using the variables you can control if open http and https ports on the iptables firewall:
enable_http: true # default enable
enable_https: false # defalut disable
VirtualHosts
This is an example for virtual host creation
nginx_vhosts:
- { domain: "git.home.local", file: "{ { playbook_dir } }/files/nginx-vhosts/git.home.local", enabled: true, ssl: false }
- { domain: "portainer.home.local", file: "{ { playbook_dir } }/files/nginx-vhosts/portainer.home.local", enabled: true, ssl: false }
- { domain: "dns.home.local", file: "{ { playbook_dir } }/files/nginx-vhosts/dns.home.local", enabled: true, ssl: false }
- { domain: "torrent.home.local", file: "{ { playbook_dir } }/files/nginx-vhosts/torrent.home.local", enabled: true, ssl: false }
Where:
- domain: is the web site domain
- file: is the local path to the virtual host configuration file
- enabled: enable/disable the host
- ssl: enable/disable ssl certificates
References
© 2024 Stefano Prina
Quest'opera è distribuita con Licenza Creative Commons Attribuzione - Condividi allo stesso modo 4.0 Internazionale Theme Moonwalk
Quest'opera è distribuita con Licenza Creative Commons Attribuzione - Condividi allo stesso modo 4.0 Internazionale Theme Moonwalk