Proxy configuration

Iry Witham Iry.Witham at
Wed Aug 17 12:01:18 UTC 2011

   I am working on an issue with Nginx, using it as the proxy server for our internal Galaxy server.  We are attempting to use the IGV module in Galaxy and when we use the option to view BAM files in the browser we get a Java Runtime error.  So far the only way around the error is to modify the URL to be http://galaxy:8080/.  I am able to use the other available options just fine.  I have been involved in conversations with both Galaxy-Dev and IGV support.  The later suggested that I mention the following:

“The issue I have seen with some proxy servers is that
they rewrite the request header and in the process remove a "range-byte"
request header.   This is critical and should not be removed.”

    Here is a copy of our nginx.conf file.  I removed the trailing portion since it is commented out:

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
error_log logs/error.log debug;

#pid        logs/;

events {
    worker_connections  1024;

user galaxy galaxy;
http {
    include       mime.types;
    default_type  application/octet-stream;

    #  Added for compression and caching.  According to Galaxy wiki page:
    #  This will decrease downlod and page load times for clients
    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)";

    #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  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    #  Added to support proxying to galaxy server
    upstream galaxy_app {
        server localhost:8080;
        server localhost:8081;
        server localhost:8082;

    server {
        listen       80;
       *** listen localhost:80; ***
        server_name  localhost;
    # Line added for galaxy support
    client_max_body_size 10G;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

    #  Added to allow nginx to handle file uploads
        location /_upload {
            upload_store /hpcdata/galaxy-setup/galaxy-dist/database/tmp/upload_store;

            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;

        #  added to allow nginx to handle file downloads
        location /_x_accel_redirect/ {
            alias /;

    #  The following series of "locations" are for off-loading static
    #  content from the galaxy server.
        location /static {
            alias /hpcdata/galaxy-setup/galaxy-dist/static;
            #  This will decrease downlod and page load times for clients
            expires 24h;
        location /static/style {
            alias /hpcdata/galaxy-setup/galaxy-dist/static/june_2007_style/blue;
        location /static/scripts {
            alias /hpcdata/galaxy-setup/galaxy-dist/static/scripts/packed;
            #  This will decrease downlod and page load times for clients
            expires 24h;
        location /favicon.ico {
            alias /hpcdata/galaxy-setup/galaxy-dist/static/favicon.ico;
        location /robots.txt {
            alias /hpcdata/galaxy-setup/galaxy-dist/static/robots.txt;
        #  End of static content

        location / {
        # next two lines commented out for galaxy redirect
            #root   html;
            #index  index.html index.htm;
            proxy_pass   http://galaxy_app;
            *** proxy_pass   http://galaxy_app:8080; ***
            proxy_read_timeout 500;
            proxy_next_upstream error;
            proxy_set_header   X-Forwarded-Host $host;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;

Is there something that I am missing?  Any assistance would be greatly appreciated.


Iry Witham
Applications Administrator
Scientific Computing Group
Computational Sciences Dept.
The Jackson Laboratory
600 Main Street
Bar Harbor, ME  04609
Phone: 207-288-6744
email: iry.witham at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list