Skip to content

Instantly share code, notes, and snippets.

@pvanheus
Created March 18, 2018 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvanheus/11be247973be15806a520556775a4d5c to your computer and use it in GitHub Desktop.
Save pvanheus/11be247973be15806a520556775a4d5c to your computer and use it in GitHub Desktop.
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