1 # DO NOT EDIT - This file is being maintained by Chef
4 ServerName <%= @name %>
5 <% @aliases.each do |alias_name| -%>
6 ServerAlias <%= alias_name %>
9 ServerAdmin webmaster@openstreetmap.org
11 CustomLog /var/log/apache2/<%= @name %>-access.log combined
12 ErrorLog /var/log/apache2/<%= @name %>-error.log
14 RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
15 RedirectPermanent / https://<%= @name %>/
19 ServerName <%= @name %>
20 <% @aliases.each do |alias_name| -%>
21 ServerAlias <%= alias_name %>
23 ServerAdmin webmaster@openstreetmap.org
26 SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
27 SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
29 CustomLog /var/log/apache2/<%= @name %>-access.log combined
30 ErrorLog /var/log/apache2/<%= @name %>-error.log
33 DocumentRoot <%= @directory %>
34 <% @urls.each do |url,directory| -%>
35 Alias <%= url %> <%= directory %>
36 <Directory <%= directory %>>
39 <FilesMatch ".+\.ph(ar|p|tml)$">
45 <Directory <%= @directory %>>
48 RewriteRule ^wp-admin/includes/ - [F,L]
49 RewriteRule !^wp-includes/ - [S=3]
50 RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
51 RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
52 RewriteRule ^wp-includes/theme-compat/ - [F,L]
53 RewriteRule ^readme\.html$ [F,L]
54 RewriteRule ^index\.php$ - [L]
55 RewriteCond %{REQUEST_FILENAME} !-f
56 RewriteCond %{REQUEST_FILENAME} !-d
57 RewriteRule . /index.php [L]
60 AllowOverride AuthConfig
64 # https://www.wp-pay.org/http-authorization-header-missing/
67 <FilesMatch ".+\.ph(ar|p|tml)$">
68 SetHandler "proxy:unix:/run/php/php-<%= @name %>-fpm.sock|fcgi://127.0.0.1"
72 <Files <%= @directory %>/wp-config.php>
76 <Directory <%= @directory %>/uploads>
78 AddType text/plain .html .htm .shtml
79 <FilesMatch ".+\.ph(ar|p|tml)$">
92 <Files ~ "(?<!robots|ads|security|humans)\.(txt|md)$">