aboutsummaryrefslogtreecommitdiffstats
path: root/roles/httpd/templates
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2024-02-08 13:32:37 +0100
committerRomain Gonçalves <me@rgoncalves.se>2024-02-08 13:33:36 +0100
commitadfb09b9e19f7a31632eab01171693cb81ec75ef (patch)
tree7b05135581ff49e7a5655ab07af7bba2ada43585 /roles/httpd/templates
parent5c5b0fbf68dca224b7f92f5de0913fd684e7d3d9 (diff)
downloadrules-adfb09b9e19f7a31632eab01171693cb81ec75ef.tar.gz
refactor(roles): new variable naming standard
Diffstat (limited to 'roles/httpd/templates')
-rw-r--r--roles/httpd/templates/httpd.conf.j222
1 files changed, 18 insertions, 4 deletions
diff --git a/roles/httpd/templates/httpd.conf.j2 b/roles/httpd/templates/httpd.conf.j2
index 49e928d..9225244 100644
--- a/roles/httpd/templates/httpd.conf.j2
+++ b/roles/httpd/templates/httpd.conf.j2
@@ -1,24 +1,38 @@
# managed by Ansible
types {
-{% for type in httpd_supported_types %}
+{% for type in httpd__supported_types %}
{{ type }}
{% endfor %}
}
-server "acme" {
- listen on localhost port 8888
+server "default" {
+ listen on * port 8888
+ log style {{ httpd__log_format }}
+ # acme tls challenge
location "/.well-known/acme-challenge/*" {
root "/acme"
request strip 2
}
+ # redirection
location * {
block return 302 "https://$HTTP_HOST$REQUEST_URI"
}
}
-{% for file in httpd_configuration_files.files %}
+{% for item in httpd__rules %}
+{% if item.extra.type is defined and item.extra.type == "static" %}
+server "{{ item.domain }}" {
+ listen on localhost port {{ item.port }}
+ log style {{ httpd__log_format }}
+ root "{{ httpd_pre__chroot_sites_dir }}/{{ item.domain }}"
+}
+
+{% endif %}
+{% endfor %}
+
+{% for file in httpd__configuration_files.files %}
include "{{ file.path }}"
{% endfor %}
remember that computers suck.