Nginx 504 Gateway Timeout

I am running a rails3.0.7 project with a phusion passenger on nginx. While I was doing ajax, which took about 15 minutes to process. He jumped in error with firebug, which said “504 Gateway Time-out” 10 minutes after ajax call.

Can someone give me some idea how I can find the problem.

Thanks ben

the environment

  • OS: mac osx 10.6.7
  • ruby: 1.9.2p180 installed with rvm
  • gem: 1.6.2
  • passenger 3.0.7
  • rails: 3.0.7
  • mysql: 5.5.10 installed with brew
  • nginx: 1.0.0 is autonomously installed with passender
+6
source share
4 answers

This is a nginx timeout error. Take a look at the following article for some hints as to which parameter you need to configure in order to avoid a timeout if you really want to allow more than 10 minutes to complete the task.

How to prevent gateway timeout with nginx

+6
source

I had a similar problem with Rails 4 on Mac OS X (Yosemite). Therefore, I added the following to my specific Nginx location.

proxy_connect_timeout 43200000; proxy_read_timeout 43200000; proxy_send_timeout 43200000; 

So, my general configuration for Nginx is as below.

 location /my_sub_path/ { root /my/rails/project/public/folder/path proxy_http_version 1.1; chunked_transfer_encoding off; proxy_buffering off; proxy_cache off; proxy_connect_timeout 43200000; proxy_read_timeout 43200000; proxy_send_timeout 43200000; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:3000/; } 
+2
source

This is a problem from the phusion passenger. You must modify the file: (gems> passenger-3.0.18> ext> nginx> Configuration.c)

 ngx_conf_merge_msec_value(conf->upstream_config.send_timeout, prev->upstream_config.send_timeout, 6000000); ngx_conf_merge_msec_value(conf->upstream_config.read_timeout, prev->upstream_config.read_timeout, 6000000); 

The occurrence timeout is 600,000, only 10 minutes. I tried changing nginx.conf but it did not work.

0
source

This is a nginx timeout error.

-3
source

Source: https://habr.com/ru/post/888709/


All Articles