aboutsummaryrefslogtreecommitdiffstats
path: root/roles/httpd/templates/httpd.conf.j2
blob: 9bfb5621e7d84ec0f4061e41fe1c91846e1b5122 (plain) (blame)
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
35
36
37
38
39
# managed by Ansible

types {
{% for type in httpd__supported_types %}
	{{ type }}
{% endfor %}
}

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 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 }}"
	gzip-static
}

{% endif %}
{% endfor %}

{% for file in httpd__configuration_files.files %}
include "{{ file.path }}"
{% endfor %}
remember that computers suck.