-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoab_dev_getter_nginx
94 lines (84 loc) · 2.89 KB
/
oab_dev_getter_nginx
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# example nginx config to ensure content can be served to getter and not cause infinte loops
server {
listen 80;
server_name dev.openaccessbutton.org;
return 301 https://dev.openaccessbutton.org$request_uri;
}
server {
listen 443;
server_name dev.openaccessbutton.org;
root /home/cloo/dev/openresearchbutton/website;
ssl on;
ssl_certificate /etc/letsencrypt/live/dev.openaccessbutton.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dev.openaccessbutton.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
ssl_stapling on;
add_header Pragma public;
add_header Cache-Control "public";
add_header Access-Control-Allow-Origin *;
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt;
}
location = /.well-known/acme-challenge/ {
return 404;
}
rewrite ^/requests /request;
rewrite ^/request/((?!new).)*$ /request/item last;
rewrite ^/response/((?!new).)*$ /response/item last;
rewrite ^/dnr/((?!new).)*$ /dnr/item last;
location / {
try_files /serve/$uri /serve/$uri.html /serve/$uri/index.html /serve/404.html =404;
}
location /content {
try_files $uri $uri.html $uri.md $uri/index $uri/index.html $uri/index.md =404;
}
location /static {
try_files /serve/$uri $uri =404;
expires 30d;
}
location ~ /url/(?<url>.+) {
proxy_pass http://noddy_dev/api/academic/redirect?url=$url;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /doi {
proxy_pass http://noddy_dev/api/academic/redirect/doi;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /pmc {
proxy_pass http://noddy_dev/api/academic/redirect/pmc;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /pmid {
proxy_pass http://noddy_dev/api/academic/redirect/pmid;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /title {
proxy_pass http://noddy_dev/api/academic/redirect/title;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /citation {
proxy_pass http://noddy_dev/api/academic/redirect/citation;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}