1 # DO NOT EDIT - This file is being maintained by Chef
3 <% [80, 443].each do |port| -%>
4 <VirtualHost *:<%= port %>>
5 ServerName <%= node[:fqdn] %>
6 ServerAlias nominatim.openstreetmap.org
7 ServerAlias nominatim.osm.org
8 ServerAlias nominatim.openstreetmap.org
9 ServerAlias nominatim.openstreetmap.net
10 ServerAlias nominatim.openstreetmaps.org
11 ServerAlias nominatim.openmaps.org
12 ServerAdmin webmaster@openstreetmap.org
22 CustomLog /var/log/apache2/nominatim.openstreetmap.org-access.log combined
23 ErrorLog /var/log/apache2/nominatim.openstreetmap.org-error.log
25 DocumentRoot <%= @directory %>/website
26 <Directory "<%= @directory %>/website/">
27 DirectoryIndex search.php
28 Options FollowSymLinks
32 ProxyPassMatch ^/([^/]*\.php(/.*)?)$ fcgi://127.0.0.1:<%= @pools[:www][:port ]%><%= @directory %>/website/$1
34 <% @pools.each do |name,details| -%>
35 Alias /pool-<%= name %>/ "<%= @directory %>/website/"
36 <% node[:nominatim][:redirects].each do |url,host| -%>
37 ProxyPassMatch ^/pool-<%= name %>/(<%= url %>\.php(/.*)?) http<% if port == 443 -%>s<% end -%>://<%= host %>/pool-<%= name %>/$1
39 ProxyPassMatch ^/pool-<%= name %>/(.*\.php(/.*)?) fcgi://127.0.0.1:<%= details[:port ]%><%= @directory %>/website/$1
42 Redirect 429 /pool-block/
43 ErrorDocument 429 /509.html
44 <Location /pool-block>
45 ErrorDocument 429 /509.html
47 Redirect 403 /pool-ban/
49 ErrorDocument 403 /403.html
51 ErrorDocument 403 /403.html
56 Include <%= @directory %>/settings/apache_blocks.conf
58 # regular requests and autoblocks
59 RewriteMap bulklist txt:<%= @directory %>/settings/ip_blocks.map
60 RewriteRule ^/(search|reverse|details)(\.php)?(/.*)? /pool-${bulklist:%{REMOTE_ADDR}|www}/$1.php$3 [PT]