]> git.openstreetmap.org Git - chef.git/blob - cookbooks/prometheus/templates/default/apache.erb
Block public access to raw grafana metrics
[chef.git] / cookbooks / prometheus / templates / default / apache.erb
1 # DO NOT EDIT - This file is being maintained by Prometheus
2
3 <VirtualHost *:80>
4         ServerName prometheus.openstreetmap.org
5         ServerAlias prometheus.osm.org
6         ServerAdmin webmaster@openstreetmap.org
7
8         CustomLog /var/log/apache2/prometheus.openstreetmap.org-access.log combined_extended
9         ErrorLog /var/log/apache2/prometheus.openstreetmap.org-error.log
10
11         RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
12         Redirect permanent / https://prometheus.openstreetmap.org/
13 </VirtualHost>
14
15 <VirtualHost *:443>
16         ServerName prometheus.openstreetmap.org
17         ServerAdmin webmaster@openstreetmap.org
18
19         CustomLog /var/log/apache2/prometheus.openstreetmap.org-access.log combined_extended
20         ErrorLog /var/log/apache2/prometheus.openstreetmap.org-error.log
21
22         SSLEngine on
23         SSLCertificateFile /etc/ssl/certs/prometheus.openstreetmap.org.pem
24         SSLCertificateKeyFile /etc/ssl/private/prometheus.openstreetmap.org.key
25
26         ProxyPass /prometheus http://localhost:9090/prometheus
27         ProxyPass /alertmanager http://localhost:9093/alertmanager
28         ProxyPass /karma http://localhost:8081/karma
29         ProxyPass /api/live/ws ws://localhost:3000/api/live/ws
30         ProxyPass / http://localhost:3000/
31         ProxyPreserveHost on
32
33         <Location /prometheus/api/v1/admin>
34                 Require all denied
35         </Location>
36
37         <Location /metrics>
38                 Require all denied
39         </Location>
40
41         <Location /alertmanager>
42 <% @admin_hosts.each do |host| -%>
43                 Require ip <%= host %>
44 <% end -%>
45         </Location>
46
47         <Location /karma>
48 <% @admin_hosts.each do |host| -%>
49                 Require ip <%= host %>
50 <% end -%>
51         </Location>
52 </VirtualHost>
53
54 <VirtualHost *:80>
55   ServerName munin.openstreetmap.org
56   ServerAlias munin.osm.org
57   ServerAdmin webmaster@openstreetmap.org
58
59   CustomLog /var/log/apache2/munin.openstreetmap.org-access.log combined_extended
60   ErrorLog /var/log/apache2/munin.openstreetmap.org-error.log
61
62   RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
63   Redirect permanent / https://prometheus.openstreetmap.org/
64 </VirtualHost>
65
66 <VirtualHost *:443>
67   ServerName munin.openstreetmap.org
68   ServerAlias munin.osm.org
69   ServerAdmin webmaster@openstreetmap.org
70
71   CustomLog /var/log/apache2/munin.openstreetmap.org-access.log combined_extended
72   ErrorLog /var/log/apache2/munin.openstreetmap.org-error.log
73
74   SSLEngine on
75   SSLCertificateFile /etc/ssl/certs/prometheus.openstreetmap.org.pem
76   SSLCertificateKeyFile /etc/ssl/private/prometheus.openstreetmap.org.key
77
78   Redirect permanent / https://prometheus.openstreetmap.org/
79 </VirtualHost>