-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglycoshape.io
88 lines (70 loc) · 2.73 KB
/
glycoshape.io
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
#/etc/nginx/sites-available/glycoshape.org
server {
if ($host = glycoshape.io) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name glycoshape.io;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name glycoshape.io;
ssl_certificate /etc/letsencrypt/live/glycoshape.io/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/glycoshape.io/privkey.pem; # managed by Certbot
location / {
try_files $uri /index.html;
if ($request_method = 'OPTIONS') {
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-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
# Other directives for GET, POST, etc.
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';
alias /mnt/database/GlycoShape/glycoshape-website/build_dev/;
autoindex on; # Enable listing of directory
}
location /database/ {
alias /mnt/database/DB_temp/;
autoindex off;
include /etc/nginx/cors.conf;
}
location /api/ {
client_max_body_size 2056M;
client_body_buffer_size 10M;
proxy_read_timeout 10000;
proxy_connect_timeout 10000;
proxy_send_timeout 10000;
proxy_pass http://127.0.0.1:8001; # Assuming Gunicorn is running on this port
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io {
proxy_pass http://127.0.0.1:8001/socket.io;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location /output/ {
alias /mnt/database/server_dir/;
autoindex off;
include /etc/nginx/cors.conf;
}
location /reglyco/ {
alias /home/ubuntu/Re-Glyco/static/;
autoindex on;
}
}