]> git.openstreetmap.org Git - chef.git/blob - cookbooks/planet/templates/default/apache.erb
Revert "Make planet redirect to https"
[chef.git] / cookbooks / planet / templates / default / apache.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2 <% [80, 443].each do |port| -%>
3    
4 <VirtualHost *:<%= port %>>
5         ServerName planet.openstreetmap.org
6         ServerAlias planet.osm.org
7         ServerAdmin webmaster@openstreetmap.org
8
9 <% if port == 443 -%>
10         SSLEngine on
11         SSLCertificateFile /etc/ssl/certs/planet.openstreetmap.org.pem
12         SSLCertificateKeyFile /etc/ssl/private/planet.openstreetmap.org.key
13 <% else -%>
14         RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
15 <% end -%>
16
17         CustomLog /var/log/apache2/planet.openstreetmap.org-access.log combined
18         ErrorLog /var/log/apache2/planet.openstreetmap.org-error.log
19
20         DocumentRoot /store/planet
21
22         <Directory /store/planet>
23                 Options Indexes FollowSymLinks MultiViews ExecCGI
24                 AllowOverride All
25                 IndexIgnore .ht* . robots.txt HEADER.html HEADER.cgi logo.png style.css
26                 IndexOptions FancyIndexing FoldersFirst NameWidth=* TrackModified SuppressHTMLPreamble
27                 HeaderName HEADER.cgi
28                 IndexOrderDefault Descending Date
29                 AddType text/html .cgi
30                 AddHandler cgi-script .cgi
31                 Require all granted
32         </Directory>
33
34         ProxyPass /replication/streaming http://127.0.0.1:8080
35
36         <Location /replication/steaming>
37                 Require all granted
38         </Location>
39
40         Redirect /pbf-experimental/     /pbf/
41
42         <IfModule mod_headers.c>
43                 Header set Access-Control-Allow-Origin "*"
44         </IfModule>
45
46         RewriteEngine on
47         RewriteMap latestplanet prg:/usr/local/bin/apache-latest-planet-filename
48
49         #Direct, no redirect for the following
50         RewriteCond     %{REMOTE_ADDR}  ^193\.63\.              [OR]
51         RewriteCond     %{REMOTE_ADDR}  ^127\.                  [OR]
52         RewriteCond     %{REMOTE_ADDR}  ^10\.                   [OR]
53         RewriteCond     %{REMOTE_ADDR}  ^193\.1\.219\.88        [OR]
54         RewriteCond     %{REMOTE_ADDR}  ^193\.1\.193\.64        [OR]
55         RewriteCond     %{REMOTE_ADDR}  ^146\.169\.             [OR]
56         RewriteCond     %{REMOTE_ADDR}  ^129\.31\.              [OR]
57         RewriteCond     %{REMOTE_ADDR}  ^193\.60\.              [OR]
58         RewriteCond     %{REMOTE_ADDR}  ^193\.61\.              [OR]
59         RewriteCond     %{REMOTE_ADDR}  ^193\.62\.              [OR]
60         RewriteCond     %{REMOTE_ADDR}  ^193\.63\.              [OR]
61         RewriteCond     %{QUERY_STRING} nomirror
62         RewriteRule     .*      - [L]
63
64         RewriteRule     ^(/planet/planet\-latest\.osm\.bz2)$    ${latestplanet:$1}      [R,L]
65 </VirtualHost>
66 <% end -%>