]> git.openstreetmap.org Git - chef.git/blob - cookbooks/dev/templates/default/apache.rails.erb
imagery: use limit_as on service
[chef.git] / cookbooks / dev / templates / default / apache.rails.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <VirtualHost *:443>
4         ServerName <%= @name %>
5 <% @aliases.each do |alias_name| -%>
6         ServerAlias <%= alias_name %>
7 <% end -%>
8         ServerAdmin webmaster@openstreetmap.org
9
10         SSLEngine on
11         SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
12         SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
13
14         CustomLog /var/log/apache2/<%= @name %>-access.log combined
15         ErrorLog /var/log/apache2/<%= @name %>-error.log
16
17         DocumentRoot /srv/<%= @name %>/rails/public
18
19         RailsEnv production
20         PassengerAppGroupName <%= @application_name %>
21
22         SetEnv SECRET_KEY_BASE <%= @secret_key_base %>
23
24         # Ensure robots do not index dev site
25         # https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
26         Header set X-Robots-Tag "noindex, nofollow"
27
28         # Force special MIME type for crossdomain.xml files
29         <Files crossdomain.xml>
30                 ForceType text/x-cross-domain-policy
31         </Files>
32 <% if @cgimap_enabled -%>
33
34         # Pass authentication related headers to cgimap
35         <Location />
36                 CGIPassAuth On
37         </Location>
38
39         # Set a long timeout for proxying to cgimap
40         ProxyTimeout 3600
41
42         # Pass supported calls to cgimap
43         RewriteEngine on
44         RewriteRule ^/api/0\.6/map(\.json)?$ fcgi://127.0.0.1:<%= @cgimap_port %>$0 [P]
45         RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$
46         RewriteRule ^/api/0\.6/(node|way|relation|changeset)/[0-9]+(\.json)?$ fcgi://127.0.0.1:<%= @cgimap_port %>$0 [P]
47         RewriteRule ^/api/0\.6/(node|way|relation)/[0-9]+/history(\.json)?$ fcgi://127.0.0.1:<%= @cgimap_port %>$0 [P]
48         RewriteRule ^/api/0\.6/(way|relation)/[0-9]+/full(\.json)?$ fcgi://127.0.0.1:<%= @cgimap_port %>$0 [P]
49         RewriteRule ^/api/0\.6/(nodes|ways|relations)(\.json)?$ fcgi://127.0.0.1:<%= @cgimap_port %>$0 [P]
50         RewriteRule ^/api/0\.6/changeset/[0-9]+/(upload|download)(\.json)?$ fcgi://127.0.0.1:<%= @cgimap_port %>$0 [P]
51 <% end -%>
52 </VirtualHost>
53
54 <VirtualHost *:80>
55         ServerName <%= @name %>
56 <% @aliases.each do |alias_name| -%>
57         ServerAlias <%= alias_name %>
58 <% end -%>
59         ServerAdmin webmaster@openstreetmap.org
60
61         CustomLog /var/log/apache2/<%= @name %>-access.log combined
62         ErrorLog /var/log/apache2/<%= @name %>-error.log
63
64         RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
65         RedirectPermanent / https://<%= @name %>/
66
67         # Ensure robots do not index dev site
68         # https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
69         Header set X-Robots-Tag "noindex, nofollow"
70 </VirtualHost>
71
72 <Directory /srv/<%= @name %>/rails/public>
73         Require all granted
74 </Directory>
75
76 <Directory /srv/<%= @name %>/rails/app/assets>
77         Require all granted
78 </Directory>
79
80 <Directory /srv/<%= @name %>/rails/vendor/assets>
81         Require all granted
82 </Directory>