]> git.openstreetmap.org Git - chef.git/blob - cookbooks/gps-tile/templates/default/apache.erb
Redirect all gps-tile access to https
[chef.git] / cookbooks / gps-tile / templates / default / apache.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <VirtualHost *:443>
4   # Basic server configuration
5   ServerName gps-tile.openstreetmap.org
6   ServerAlias *.gps-tile.openstreetmap.org
7   ServerAlias gps.tile.openstreetmap.org
8   ServerAlias gps-*.tile.openstreetmap.org
9   ServerAdmin webmaster@openstreetmap.org
10
11   # Enable SSL
12   SSLEngine on
13   SSLCertificateFile /etc/ssl/certs/gps-tile.openstreetmap.org.pem
14   SSLCertificateKeyFile /etc/ssl/private/gps-tile.openstreetmap.org.key
15
16   # Configure location of static files
17   DocumentRoot /srv/gps-tile.openstreetmap.org/html
18
19   # Configure the CGI script that serves the tiles
20   ScriptAlias /lines /srv/gps-tile.openstreetmap.org/updater/tile
21
22   # Temporary redirect for old CGI location
23   RedirectPermanent /gps-lines/tile /lines
24
25   # Setup logging
26   CustomLog /var/log/apache2/access.log combined
27   ErrorLog /var/log/apache2/error.log
28   BufferedLogs on
29
30   # Always set Access-Control-Allow-Origin so that simple CORS requests
31   # will always work and can be cached
32   Header set Access-Control-Allow-Origin "*"
33 </VirtualHost>
34
35 <VirtualHost *:80>
36   # Basic server configuration
37   ServerName gps-tile.openstreetmap.org
38   ServerAlias *.gps-tile.openstreetmap.org
39   ServerAlias gps.tile.openstreetmap.org
40   ServerAlias gps-*.tile.openstreetmap.org
41   ServerAdmin webmaster@openstreetmap.org
42
43   # Enable rewriting
44   RewriteEngine On
45
46   # Redirect for ACME challenge validation
47   RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
48
49   # Redirect to https
50   RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=permanent,L]
51
52   # Setup logging
53   CustomLog /var/log/apache2/access.log combined
54   ErrorLog /var/log/apache2/error.log
55   BufferedLogs on
56 </VirtualHost>
57
58 <Directory /srv/gps-tile.openstreetmap.org/html>
59   Options None
60   AllowOverride None
61   Require all granted
62 </Directory>
63
64 <Directory /srv/gps-tile.openstreetmap.org/updater>
65   <Files tile>
66     Require all granted
67   </Files>
68 </Directory>