Hi all,

 

I set up the data upload using nginx as described in the wiki (https://wiki.galaxyproject.org/Admin/Config/nginxProxy, using the subdirectory /galaxy).

The uploaded file also appears inside the uploade_store folder on the galaxy server, but galaxy does not add the file.

Investigating the log files, I found the corresponding lines in the nginx.error.log:

 

# Post request is received

2016/02/29 12:55:37 [notice] 13156#0: *4 "^(GET|HEAD|POST)$" matches "POST", client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: http://172.16.12.122/galaxy/

# Upload starts

2016/02/29 12:55:37 [info] 13156#0: *4 started uploading file "boxes.txt" to "/mnt/idrive1/database/tmp/upload_store/0020132707" (field "files_0|file_data", content type "text/plain"), client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: http://172.16.12.122/galaxy/

# Upload done, the file is present in the given path

2016/02/29 12:55:37 [info] 13156#0: *4 finished uploading file "boxes.txt" to "/mnt/idrive1/database/tmp/upload_store/0020132707", client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: "http://172.16.12.122/galaxy/"

# Redirection starts?

2016/02/29 12:55:37 [notice] 13156#0: *4 "^(GET|HEAD|POST)$" matches "POST", client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: "http://172.16.12.122/galaxy/"

2016/02/29 12:55:37 [notice] 13156#0: *4 "nginx_redir=([^&]+)" does not match "", client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: "http://172.16.12.122/galaxy/"

2016/02/29 12:55:37 [notice] 13156#0: *4 "" matches "/_upload_done", client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: "http://172.16.12.122/galaxy/"

# Redirection should be done here

2016/02/29 12:55:37 [notice] 13156#0: *4 rewritten data: "/galaxy/api/tools", args: "", client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: "http://172.16.12.122/galaxy/"

# ModSecurity seems to block the redirect?

2016/02/29 12:55:37 [info] 13156#0: *4 ModSecurity: invalid "Content-Length" header, client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: "http://172.16.12.122/galaxy/"

2016/02/29 12:55:37 [notice] 13156#0: *4 "^(GET|HEAD|POST)$" matches "GET", client: 172.16.17.17, server: , request: "POST /_upload HTTP/1.1", host: "172.16.12.122", referrer: "http://172.16.12.122/galaxy/"

 

A ModSecurityEnabled off; within the /_upload and /_upload_done of the nginx config did not help.

Any idea why the Content-Length header causes problems and is blocked by modSec? Any workaround for ModSec to accept everything that goes from internal to internal?

 

Thanks for your help!

 

Best,

Jens