-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
50 lines (40 loc) · 1.2 KB
/
nginx.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
50
daemon off;
error_log /dev/stderr warn;
events {
}
http {
proxy_cache_path /var/lib/nginx/tmp keys_zone=cache:10m;
access_log /dev/stdout;
error_page 404 /var/lib/nginx/404.json;
server {
listen 8080;
proxy_intercept_errors on;
proxy_hide_header Content-Type;
proxy_hide_header Access-Control-Allow-Origin;
proxy_hide_header Server;
add_header Content-Type "application/rdap+json" always;
add_header Access-Control-Allow-Origin "*" always;
add_header Server "https://github.com/rdap-org/root.rdap.org" always;
location /heartbeat {
return 200;
}
location /domain {
rewrite /domain/(.*) https://rdap.iana.org/domain/$1?utm_source=root.rdap.org redirect;
}
location /domains {
rewrite /domains /root/_all.json break;
proxy_pass https://backend-data.rdap.org;
}
location ~* ^/entity/\d+-iana$ {
rewrite (?i)/entity/(\d+)-iana /registrars/$1-iana.json break;
proxy_pass https://backend-data.rdap.org;
}
location /entities {
rewrite /entities /registrars/_all.json break;
proxy_pass https://backend-data.rdap.org;
}
location / {
rewrite / https://about.rdap.org redirect;
}
}
}