]> git.openstreetmap.org Git - chef.git/blob - cookbooks/planet/templates/default/apache.erb
Configure phpfpm exporter for main wiki
[chef.git] / cookbooks / planet / templates / default / apache.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <VirtualHost *:443>
4         ServerName planet.openstreetmap.org
5         ServerAlias planet.osm.org
6         ServerAdmin webmaster@openstreetmap.org
7
8         CustomLog /var/log/apache2/planet.openstreetmap.org-access.log combined
9         ErrorLog /var/log/apache2/planet.openstreetmap.org-error.log
10
11         SSLEngine on
12         SSLCertificateFile /etc/ssl/certs/planet.openstreetmap.org.pem
13         SSLCertificateKeyFile /etc/ssl/private/planet.openstreetmap.org.key
14
15         DocumentRoot /store/planet
16
17         <Directory /store/planet>
18                 Options Indexes FollowSymLinks MultiViews ExecCGI
19                 AllowOverride All
20                 IndexIgnore .ht* . robots.txt HEADER.html HEADER.cgi logo.png style.css
21                 IndexOptions FancyIndexing FoldersFirst NameWidth=* TrackModified SuppressHTMLPreamble
22                 HeaderName HEADER.cgi
23                 IndexOrderDefault Descending Date
24                 AddType text/html .cgi
25                 AddHandler cgi-script .cgi
26                 Require all granted
27         </Directory>
28
29         ProxyPass /replication/streaming http://127.0.0.1:8080
30
31         <Location /replication/steaming>
32                 Require all granted
33         </Location>
34
35         Redirect /pbf-experimental/     /pbf/
36
37         <IfModule mod_headers.c>
38                 Header set Access-Control-Allow-Origin "*"
39         </IfModule>
40
41         RewriteEngine on
42         RewriteMap latestplanet prg:/usr/local/bin/apache-latest-planet-filename
43
44         #Direct, no redirect for the following
45         RewriteCond %{REMOTE_ADDR}  ^127\.                           [OR]
46         RewriteCond %{REMOTE_ADDR}  ^10\.                              [OR]
47         RewriteCond %{REMOTE_ADDR}  ^193\.60\.       [OR]
48         RewriteCond %{REMOTE_ADDR}  ^193\.61\.       [OR]
49         RewriteCond %{REMOTE_ADDR}  ^193\.62\.       [OR]
50         RewriteCond %{REMOTE_ADDR}  ^193\.63\.       [OR]
51         RewriteCond %{QUERY_STRING} nomirror
52         RewriteRule     .*      - [L]
53
54         RewriteRule ^(/planet/planet\-latest\.osm\.bz2)$                ${latestplanet:$1} [R,L]
55         RewriteRule ^(/planet/full\-history/history\-latest\.osm\.bz2)$ ${latestplanet:$1} [R,L]
56         RewriteRule ^(/planet/changesets\-latest\.osm\.bz2)$            ${latestplanet:$1} [R,L]
57         RewriteRule ^(/planet/discussions\-latest\.osm\.bz2)$           ${latestplanet:$1} [R,L]
58
59         RewriteRule ^(/pbf/planet\-latest\.osm\.pbf)$                   ${latestplanet:$1} [R,L]
60         RewriteRule ^(/pbf/full\-history/history\-latest\.osm\.pbf)$    ${latestplanet:$1} [R,L]
61
62         RewriteRule ^(/cc\-by\-sa/pbf/planet\-latest\.osm\.pbf)$        ${latestplanet:$1} [R,L]
63         RewriteRule ^(/cc\-by\-sa/planet\-latest\.osm\.bz2)$            ${latestplanet:$1} [R,L]
64         RewriteRule ^(/cc\-by\-sa/changesets\-latest\.osm\.bz2)$        ${latestplanet:$1} [R,L]
65         RewriteRule ^(/cc\-by\-sa/relations\-latest\.osm\.bz2)$         ${latestplanet:$1} [R,L]
66
67         # Temporary download rate limit due to upstream fibre connection issues. - 13 Jan 2020
68         <FilesMatch ".+\.(7z|bz2|gz|pbf|tgz|xz)$">
69           SetOutputFilter RATE_LIMIT
70           SetEnv rate-limit 4096
71           SetEnv rate-initial-burst 8192
72         </FilesMatch>
73 </VirtualHost>
74
75 <VirtualHost *:80>
76         ServerName planet.openstreetmap.org
77         ServerAlias planet.osm.org
78         ServerAdmin webmaster@openstreetmap.org
79
80         CustomLog /var/log/apache2/planet.openstreetmap.org-access.log combined
81         ErrorLog /var/log/apache2/planet.openstreetmap.org-error.log
82
83         RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
84         RedirectPermanent / https://planet.openstreetmap.org/
85 </VirtualHost>