I have a very basic setup of ngnix as a proxy to unicorn on a socket,
everyhing works almost just fine,
the only problem I have is that when a request to https:// takes more than 5 secons,
then I get a disconect (or 304 error in chrome),
the same request to the http page of it, comes just fine.
there's no overwrite of any of the default timeout values, (which are all 60 seconds)
the reverse proxy config is here
upstream unicorn_server {
# this socket is set up on the config/unicorn.rb file
server unix:/home/sage/apps/sage/production/shared/.unicorn.sock;
}
server {
listen 80;
root /home/sage/apps/sage/production/current/public;
location / {
proxy_set_header X-Forwarded-For $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://unicorn_server;
break;
}
}
}
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/certs/cert.com.chained.crt;
ssl_certificate_key /etc/ssl/certs/sert.com.key;
root /home/sage/apps/sage/production/current/public;
location / {
proxy_set_header X-Forwarded-For $scheme;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://unicorn_server;
break;
}
}
}