forked from Scifabric/pybossa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpybossa.nginx.presed
62 lines (47 loc) · 1.72 KB
/
pybossa.nginx.presed
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
server {
listen 8000;
server_name pb.citizenscience.ch;
large_client_header_buffers 4 32k;
real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;
#map $http_origin $myHttpOriginVariable {
# default $http_origin;
# "" "*";
#}
#add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'client_max_body_size' '100M';
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET,PUT,POST,PATCH,OPTIONS,PUT';
add_header 'Access-Control-Allow-Headers' 'X-CSRFToken,X-Csrf-Token,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
# change that to your pybossa directory
root /opt/pybossa;
client_max_body_size 100M;
if (-f /opt/pybossa/503.html) {
return 503;
}
#error_page 405 =200 $uri;
error_page 503 @maintenance;
location / { try_files $uri @pybossa; proxy_pass_header X-CSRF-TOKEN;}
location @pybossa { proxy_pass_header X-CSRF-TOKEN;
include uwsgi_params;
uwsgi_pass unix:/tmp/pybossa.sock;
}
location /static {
# change that to your pybossa static directory
alias /opt/pybossa/pybossa/themes/default/static;
autoindex on;
expires max;
}
location ~ /api/app { proxy_pass_header X-CSRF-TOKEN;
rewrite ^/api/app /api/project$1 permanent;
}
location ~ /app {
rewrite ^/app(.*) /project$1 permanent;
}
error_page 503 @maintenance;
location @maintenance {
if ($uri !~ ^/static/) {
rewrite ^(.*)$ /503.html break;
}
}
}