1 # DO NOT EDIT - This file is being maintained by Chef
3 <% [80, 443].each do |port| -%>
4 <VirtualHost *:<%= port %>>
5 ServerName nominatim.openstreetmap.org
6 ServerAdmin webmaster@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
20 CustomLog /var/log/apache2/nominatim.openstreetmap.org-access.log combined
21 ErrorLog /var/log/apache2/nominatim.openstreetmap.org-error.log
23 DocumentRoot <%= @directory %>/website
24 <Directory "<%= @directory %>/website/">
25 DirectoryIndex search.php
26 Options MultiViews FollowSymLinks
27 AddType text/html .php
28 AddType application/xml .phpx
29 AddType application/json .phpj
30 <% if node[:lsb][:release].to_f >= 14.04 -%>
31 ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:<%= @pools[:www][:port ]%>/
32 ProxyPassMatch ^/(.*\.phpx(/.*)?)$ fcgi://127.0.0.1:<%= @pools[:www][:port ]%>/
33 ProxyPassMatch ^/(.*\.phpj(/.*)?)$ fcgi://127.0.0.1:<%= @pools[:www][:port ]%>/
35 AddHandler fcgi:/var/run/php5-fpm-www.sock .php
36 AddHandler fcgi:/var/run/php5-fpm-www.sock .phpx
37 AddHandler fcgi:/var/run/php5-fpm-www.sock .phpj
41 <% @pools.each do |name,details| -%>
42 Alias /pool-<%= name %>/ "<%= @directory %>/website/"
43 <Location /pool-<%= name %>>
44 <% if node[:lsb][:release].to_f >= 14.04 -%>
45 ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:<%= details[:port ]%>/
46 ProxyPassMatch ^/(.*\.phpx(/.*)?)$ fcgi://127.0.0.1:<%= details[:port ]%>/
47 ProxyPassMatch ^/(.*\.phpj(/.*)?)$ fcgi://127.0.0.1:<%= details[:port ]%>/
49 AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .php
50 AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .phpx
51 AddHandler fcgi:/var/run/php5-fpm-<%= name %>.sock .phpj
56 Redirect 420 /pool-block/
57 ErrorDocument 420 /509.html
58 <Location /pool-block>
59 ErrorDocument 420 /509.html
61 Redirect 403 /pool-ban/
63 ErrorDocument 403 /403.html
65 ErrorDocument 403 /403.html
70 Include <%= @directory %>/settings/apache_blocks.conf
72 # regular requests and autoblocks
73 RewriteMap bulklist txt:<%= @directory %>/settings/ip_blocks.map
74 RewriteRule ^/([sdr].*) /pool-${bulklist:%{REMOTE_ADDR}|www}/$1 [PT]