Instantly share code, notes, and snippets.

Embed
What would you like to do?
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 default_server ssl;
listen [::]:443 default_server ssl;
server_name _;
# use a variable for convenience
set $galaxy_root /galaxy/galaxysrv/galaxy;
# Enable HSTS
add_header Strict-Transport-Security "max-age=15552000; includeSubdomains";
# proxy all requests not matching other locations to uWSGI
location / {
uwsgi_pass 127.0.0.1:4001;
uwsgi_param UWSGI_SCHEME $scheme;
include uwsgi_params;
}
# serve framework static content
location /static/style {
alias $galaxy_root/static/style/blue;
expires 24h;
}
location /static {
alias $galaxy_root/static;
expires 24h;
}
location /robots.txt {
alias $galaxy_root/static/robots.txt;
expires 24h;
}
location /favicon.ico {
alias $galaxy_root/static/favicon.ico;
expires 24h;
}
# serve visualization and interactive environment plugin static content
location ~ ^/plugins/(?<plug_type>.+?)/(?<vis_name>.+?)/static/(?<static_file>.*?)$ {
alias $galaxy_root/config/plugins/$plug_type/$vis_name/static/$static_file;
expires 24;
}
location /_x_accel_redirect/ {
internal;
alias /;
}
# handle file uploads via the upload module
# location /_upload {
# upload_store /galaxy/galaxysrv/galaxy/upload_store;
# upload_store_access user:rw group:rw;
# 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
# }
# once upload is complete, redirect to the proper galaxy path
location /_upload_done {
set $dst /api/tools;
if ($args ~ nginx_redir=([^&]+)) {
set $dst $1;
}
rewrite "" $dst;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment