-
Notifications
You must be signed in to change notification settings - Fork 6
/
nginx.conf.template
205 lines (167 loc) · 5.56 KB
/
nginx.conf.template
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
index index.html index.php index.htm;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 4;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml text/javascript application/json;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6].(?!.*SV1)";
upstream galaxy_app {
server localhost:8080;
}
upstream cm_app {
server localhost:42284;
}
upstream galaxy_reports_app {
server localhost:9001;
}
upstream vnc_app {
server localhost:6080;
}
server {
listen 80;
client_max_body_size 2048m;
server_name localhost;
proxy_read_timeout 600;
include commandline_utilities_http.conf;
location /cloud {
proxy_pass http://cm_app;
proxy_set_header X-Forwarded-Host $$host;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
error_page 502 /errdoc/cm_502.html;
}
location /cloud/static {
alias /mnt/cm/static;
expires 24h;
}
location /cloud/static/style {
alias /mnt/cm/static/style;
expires 24h;
}
location /cloud/static/scripts {
alias /mnt/cm/static/scripts;
expires 24h;
}
location /reports {
rewrite ^/reports/(.*) /$$1 break;
proxy_pass http://galaxy_reports_app;
proxy_set_header X-Forwarded-Host $$host;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
}
location / {
proxy_pass http://galaxy_app;
proxy_set_header X-Forwarded-Host $$host;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
}
location /static {
alias $galaxy_home/static;
expires 24h;
}
location /static/style {
alias $galaxy_home/static/june_2007_style/blue;
expires 24h;
}
location /static/scripts {
alias $galaxy_home/static/scripts/packed;
expires 24h;
}
location /robots.txt {
alias $galaxy_home/static/robots.txt;
}
location /favicon.ico {
alias $galaxy_home/static/favicon.ico;
}
location /admin/jobs {
proxy_pass http://localhost:8079;
}
location /_x_accel_redirect/ {
internal;
alias /;
}
# VNC & noVNC settings
location ~ /vnc {
auth_pam "Secure Zone";
auth_pam_service_name "nginx";
rewrite ^(.*[^/])$$ $$1/ permanent; # redirect if no trailing slash
rewrite ^/vnc(.*) //$$1 break;
proxy_pass http://vnc_app;
proxy_http_version 1.1;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
location ~ /websockify {
proxy_pass http://vnc_app;
proxy_http_version 1.1;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
location /gvl-scf {
alias /home/ubuntu/www;
index index.php;
rewrite ^ /gvl-scf/index.php;
# This is cool because no php is touched for static content
try_files $$uri @rewrite;
location ~* \.(jpg|jpeg|gif|png|bmp|ico|pdf|flv|swf|exe|html|htm|txt|css|js) {
alias /home/ubuntu/www$$fastcgi_script_name;
expires 1d;
}
# rewrite ^/(.*)$$ /gvl-scf/index.php?q=$$1;
location ~ \.php$$ {
alias /home/ubuntu/www;
try_files $$uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_pass localhost:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 900;
fastcgi_param SCRIPT_FILENAME $$document_root$$fastcgi_script_name;
}
}
location @rewrite {
# Some modules enforce no slash (/) at the end of the URL
# Else this rewrite block wouldn't be needed (GlobalRedirect)
#root /home/ubuntu/www;
rewrite ^/(.*)$$ /gvl-scf/index.php?q=$$1;
}
location /_upload {
upload_store $nginx_upload_store_path;
upload_pass_form_field "";
upload_set_form_field "__$${upload_field_name}__is_composite" "true";
upload_set_form_field "__$${upload_field_name}__keys" "name path";
upload_set_form_field "$${upload_field_name}_name" "$$upload_file_name";
upload_set_form_field "$${upload_field_name}_path" "$$upload_tmp_path";
upload_pass_args on;
upload_pass /_upload_done;
}
location /_upload_done {
set $$dst /tool_runner/index;
if ($$args ~ nginx_redir=([^&]+)) {
set $$dst $$1;
}
rewrite "" $$dst;
}
error_page 502 /errdoc/502.html;
location /errdoc {
root html;
}
}
server {
listen 443 ssl;
client_max_body_size 2048m;
server_name localhost;
proxy_read_timeout 600;
include commandline_utilities_https.conf;
}
}