diff options
Diffstat (limited to 'roles/pihole/templates')
| -rw-r--r-- | roles/pihole/templates/pihole.nginx.conf.j2 | 17 | ||||
| -rw-r--r-- | roles/pihole/templates/pihole.toml.j2 | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/roles/pihole/templates/pihole.nginx.conf.j2 b/roles/pihole/templates/pihole.nginx.conf.j2 new file mode 100644 index 00000000..91f0fea4 --- /dev/null +++ b/roles/pihole/templates/pihole.nginx.conf.j2 @@ -0,0 +1,17 @@ +server { + listen 80; + listen [::]:80; + + server_name {{ pihole_hostname }}; + + location = / { + return 301 /admin/; + } + + location /admin/ { + proxy_pass http://127.0.0.1:{{ pihole_port }}/admin/; + } + location /api/ { + proxy_pass http://127.0.0.1:{{ pihole_port }}/api/; + } +} diff --git a/roles/pihole/templates/pihole.toml.j2 b/roles/pihole/templates/pihole.toml.j2 index 13f7ba1f..a755040b 100644 --- a/roles/pihole/templates/pihole.toml.j2 +++ b/roles/pihole/templates/pihole.toml.j2 @@ -37,6 +37,9 @@ interface = "{{ pihole_interface }}" # - "NONE" # Do not add any configuration concerning the listening mode to the dnsmasq config file. listeningMode = "LOCAL" +{% if pihole_dns_hosts | length > 0 %} +hosts = {{ pihole_dns_hosts | to_json }} +{% endif %} [dns.cache] size = 10000 # Cache size of the DNS server. |
