forked from meta-systems/openrecyclemap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openrecyclemap.conf
49 lines (36 loc) · 1.42 KB
/
openrecyclemap.conf
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
server {
listen 443 ssl;
server_name openrecyclemap.org www.openrecyclemap.org;
root /var/www/openrecyclemap;
index index.html;
location / {
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
if (!-e $request_filename){
rewrite ^/(.*) /index.html?r=$1 last;
}
}
location ~ /\.ht {
deny all;
}
ssl_certificate /etc/letsencrypt/live/openrecyclemap.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/openrecyclemap.org/privkey.pem; # managed by Certbot
}
server {
listen 80;
server_name openrecyclemap.org www.openrecyclemap.org;
return 404; # managed by Certbot
if ($host = openrecyclemap.org) {
return 301 https://$host$request_uri;
} # managed by Certbot
}