aboutsummaryrefslogtreecommitdiff
path: root/roles/nginx/Readme.md
blob: d9d648db6883f02cf2c9da4ecedee6e611b53550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# nginx

Simple role for configuring nginx servers.
The yaml keys and values are converted to raw nginx files.
See example

```yml
---
nginx:
  servers:
    default:
      listen: 443 ssl
      server_name: '{{ ansible_facts.fqdn }}'
      ssl_certificate: '/etc/ssl/certs/{{ ansible_facts.fqdn }}.pem'
      ssl_certificate_key: '/etc/ssl/private/{{ ansible_facts.fqdn }}.key'
      'location /':
        proxy_pass: http://localhost:8080
```

Produces

```nginx
# vi: ft=nginx
# This file is managed by Ansible. DO NOT CHANGE!
server {
    listen 443 ssl;
    server_name hostname;
    ssl_certificate /etc/ssl/certs/hostname.pem;
    ssl_certificate_key /etc/ssl/private/hostname.key;
    location / {
        proxy_pass http://localhost:8080;
    }
}
```