-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.apache-vhost.conf.template
55 lines (41 loc) · 1.82 KB
/
.apache-vhost.conf.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<VirtualHost *:80>
# Available domain(s)
ServerName tile.example.com
ServerAlias a.tile.example.com b.tile.example.com c.tile.example.com
# Logging
CustomLog /var/log/apache2/tile-access.log combined
ErrorLog /var/log/apache2/tile-error.log
# Where the files are
DocumentRoot /var/www/tile/
# Allow access
<Location />
Require all granted
</Location>
# Enable PHP
AddType application/x-httpd-php .php
php_value display_errors 0
# Disable MultiViews
Options -MultiViews
# Disable directory indexes
Options -Indexes
# Serve the tile directly if it exists; otherwise go through the cache
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^/([-a-z0-9]+)/([0-9]+)/([0-9]+)/(-?[0-9]+).png$ /index.php?action=tile&layer=$1&x=$3&y=$4&z=$2 [L,QSA]
RewriteRule ^/([-a-z0-9]+)/([0-9]+)/([0-9]+)/(-?[0-9]+)@([.0-9]+)x.png$ /index.php?action=tile&layer=$1&x=$3&y=$4&z=$2&scale=$5 [L,QSA]
RewriteRule ^/([-a-z0-9]+)/([-/a-z0-9]+)/([0-9]+)/([0-9]+)/(-?[0-9]+).png$ /index.php?action=tile&layer=$1&variant=$2&x=$4&y=$5&z=$3 [L,QSA]
RewriteRule ^/([-a-z0-9]+)/([-/a-z0-9]+)/([0-9]+)/([0-9]+)/(-?[0-9]+)@([.0-9]+)x.png$ /index.php?action=tile&layer=$1&variant=$2&x=$4&y=$5&z=$3&scale=$6 [L,QSA]
# Allow only a short time for upstream tile retrieval
php_value default_socket_timeout 5
# Explicitly set the timezone, a requirement of PHP 5.3+
php_value date.timezone 'Europe/London'
# Set a low-bandwidth error message for 404
ErrorDocument 404 "404 Resource not found"
# Allow cross-site HTTP requests
Header set Access-Control-Allow-Origin "*"
# Certificates, if using SSL
#SSLEngine on
SSLEngine on
#SSLCertificateFile /etc/letsencrypt/live/tile.example.com/fullchain.pem
#SSLCertificateKeyFile /etc/letsencrypt/live/tile.example.com/privkey.pem
</VirtualHost>