aboutsummaryrefslogtreecommitdiffstats
path: root/roles/httpd/templates/httpd.conf.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/httpd/templates/httpd.conf.j2')
-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.