-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
137 lines (112 loc) · 4.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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /tmp/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
env KRB5CCNAME=FILE:/tmp/krb5cc_ngnxban;
events {
worker_connections 1024;
accept_mutex off;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
#sendfile on;
include /etc/nginx/mime.types;
default_type application/octet-stream;
#disable_symlinks off;
upstream seqview {
server seqview:8000;
}
upstream higlass {
server higlass:80;
}
upstream fcgiwrap {
server fcgiwrap:9001;
}
server {
listen 80;
root /usr/share/nginx/html/;
location / {
proxy_pass http://seqview;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /img/ {
#root /usr/share/nginx/html/;
}
location /seqalignments/ {
add_header 'Access-Control-Allow-Origin' '*';
disable_symlinks off;
#root /usr/share/nginx/html/;
}
location /scripts/ {
#internal;
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/.htpasswd;
gzip off;
include /etc/nginx/fastcgi_params;
#fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/scripts/index.cgi;
fastcgi_pass fcgiwrap;
fastcgi_index index.cgi;
}
location /tracks/ {
#internal;
#add_header Access-Control-Allow-Origin $upstream_http_access_control_allow_origin;
add_header 'Access-Control-Allow-Origin' '*';
disable_symlinks off;
#root /usr/share/nginx/html/;
}
location /static/ {
alias /usr/share/nginx/html/static/;
}
location /trackHubs/ {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
# Om nom nom cookies
#
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}
}
location ~* ^/higlass/api/v1/(.*) {
internal;
proxy_set_header Cookie "";
proxy_pass http://higlass/api/v1/$1/$is_args$args;
}
location /resources/ {
alias /usr/share/nginx/html/resources/;
}
}
}