]> git.openstreetmap.org Git - chef.git/blob - cookbooks/vectortile/templates/default/nginx.erb
Merge remote-tracking branch 'github/pull/790'
[chef.git] / cookbooks / vectortile / templates / default / nginx.erb
1 upstream tilekiln {
2     server 127.0.0.1:8000;
3 }
4
5 upstream demo {
6     server 127.0.0.1:8080;
7 }
8
9 server {
10     listen 80 default_server;
11     listen [::]:80 default_server;
12
13     location /nginx_status {
14         stub_status on;
15         access_log   off;
16         allow 127.0.0.1;
17         allow ::1;
18         deny all;
19     }
20
21      rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;
22
23      location / {
24          return 301 https://$host$request_uri;
25      }
26 }
27
28 server {
29     # IPv4
30     listen       443 ssl default_server;
31     # IPv6
32     listen       [::]:443 ssl default_server;
33     http2 on;
34     server_name  localhost;
35
36     ssl_certificate /etc/ssl/certs/<%= node[:fqdn] %>.pem;
37     ssl_certificate_key /etc/ssl/private/<%= node[:fqdn] %>.key;
38
39     location /nginx_status {
40         stub_status on;
41         access_log   off;
42         allow 127.0.0.1;
43         allow ::1;
44         deny all;
45     }
46     location /shortbread_v1/ {
47         proxy_pass http://tilekiln;
48         proxy_http_version 1.1;
49         proxy_set_header Connection "";
50         add_header Cache-Control "public,max-age=300,stale-while-revalidate=3600,stale-if-error=86400";
51     }
52     location /demo/ {
53         proxy_pass http://demo;
54         proxy_http_version 1.1;
55         proxy_set_header Connection "";
56     }
57     root /srv/vector.openstreetmap.org/html;
58 }