aboutsummaryrefslogblamecommitdiffstats
path: root/roles/httpd/templates/httpd.conf.j2
blob: 0c390863542d7e4db52fdbdf5ffa4a125bfc3395 (plain) (tree)
1
2
3
4
5
6
7
8


                    
                                        

                  

 


                                         
 
                            




                                                  
                     



                                                                 
 




                                                                   
                   





                                                                  





                                                  

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

	root "{{ httpd_pre__chroot_sites_dir }}/{{ item.domain }}"

	location "/public/*" {
		directory auto index
	}
}

{% endif %}
{% endfor %}

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