I have Passenger configured on my nginx server to serve a Rails app from a specific domain.
I need a certain path (/works
) on my app not to time out after 60s because it takes a while for me to upload files and I suspect the timeout is firing too early. I wanted to use proxy_connect_timeout
to solve the issue.
I tried to use a location block specific to that path in order to increase the timeout, but it causes every request for /works
(or any subpath) to result in a 404.
server {
listen 80;
server_name myserver.com;
root /path/to/my/app/public;
passenger_enabled on;
location /works {
proxy_connect_timeout 300s;
}
}
This is the entry in error.log
:
2014/02/10 04:30:31 [error] 9579#0: *4 "/path/to/my/app/public/works/index.html" is not found (2: No such file or directory), client: 0.0.0.0, server: myserver.com, request: "GET /works/ HTTP/1.1", host: "myserver.com"
From what I can glean from that entry, it seems to look into public as if it didn't know it should pass the request to Rails. I also tried enabling passenger from that location block but with no luck.
How do I get this to work? Is there also a way to make the location block only act on /works
and not on any subpath (e.g. /works/1
)?