]> git.openstreetmap.org Git - chef.git/blob - cookbooks/dev/templates/default/apache.rails.erb
Configure server_protocol and server_url correctly
[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 %>/public
18
19         RailsEnv production
20
21         SetEnv SECRET_KEY_BASE <%= @secret_key_base %>
22 </VirtualHost>
23
24 <VirtualHost *:80>
25         ServerName <%= @name %>
26 <% @aliases.each do |alias_name| -%>
27         ServerAlias <%= alias_name %>
28 <% end -%>
29         ServerAdmin webmaster@openstreetmap.org
30
31         CustomLog /var/log/apache2/<%= @name %>-access.log combined
32         ErrorLog /var/log/apache2/<%= @name %>-error.log
33
34         RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
35         RedirectPermanent / https://<%= @name %>/
36 </VirtualHost>
37
38 <Directory /srv/<%= @name %>/public>
39         Require all granted
40 </Directory>
41
42 <Directory /srv/<%= @name %>/app/assets>
43         Require all granted
44 </Directory>
45
46 <Directory /srv/<%= @name %>/vendor/assets>
47         Require all granted
48 </Directory>