https://github.com/jlu5/ansible-nginx
Ansible role to configure nginx & virtual hosts
https://github.com/jlu5/ansible-nginx
Last synced: 2 months ago
JSON representation
Ansible role to configure nginx & virtual hosts
- Host: GitHub
- URL: https://github.com/jlu5/ansible-nginx
- Owner: jlu5
- License: mit
- Created: 2021-07-08T05:26:48.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-07T19:30:43.000Z (almost 3 years ago)
- Last Synced: 2025-01-14T09:57:42.987Z (4 months ago)
- Language: Jinja
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-nginx
A quick Ansible role to configure nginx, virtual hosts, and (optionally) Let's Encrypt certificates with webhook validation.
I also attempt to keep this role up to date with [Mozilla's SSL Config Generator](https://ssl-config.mozilla.org/#server=nginx&config=intermediate&hsts=false&ocsp=false) (see `snippets/nginx-ssl.conf.j2`)
## Variables
```yaml
# Site to configure. src is the source template file of an nginx `server{}` directive (usually from the including role), dst is the name to upload it as under /etc/nginx/sites-available
nginx_site:
src: srcfile.conf.j2
dst: srcfile.conf# If non-empty, attempts to create an SSL certificate for the given domains using certbot's webroot validation
letsencrypt_domains: []# webroot path for certbot validation
letsencrypt_webroot_path: /var/www/html
letsencrypt_account_email: your@email
```