redmine export long csv file failed: 502 proxy error
After modified the file \apps\redmine\conf\httpd-vhosts.conf:
<VirtualHost *:8080>
ServerName redmine.example.com
ServerAlias www.redmine.example.com
DocumentRoot "D:\App\Bitnami\redmine-3.3.0-0/apps/redmine/htdocs/public"
<Directory "D:\App\Bitnami\redmine-3.3.0-0/apps/redmine/htdocs/public">
Options -MultiViews
allow from all
</Directory>Timeout 1200 # wuyan add, invalid
RewriteEngine On
RewriteRule ^/(.*)$ balancer://redminecluster%{REQUEST_URI} [P,QSA,L]
<Proxy balancer://redminecluster>
BalancerMember http://127.0.0.1:3001 timeout=1200 # wuyan modify,invalid
BalancerMember http://127.0.0.1:3002 timeout=1200 # wuyan modify,invalid
</Proxy>
Include "D:\App\Bitnami\redmine-3.3.0-0/apps/redmine/conf/httpd-app.conf"
</VirtualHost>
Now everything seems ok!
Continue:
When the records is larger than 1500, it failed again! google and google again, i found the new info:
1) as this page showed, i tried the access from port 3001(127.0.0.1:3001/), it was ok!
2) as this page showed, the default timeout of thin server is 30 seconds, we can set it with: thin -t 60.
3) as this page showed, the default timeout of apache is 300 seconds. and the default value of ProxyTimeout is the same.
4) when i export csv with port 8080(the virtual host port), it will return the 502 proxy error after about 60 seconds.
5) the access path is: apache, the proxy balancer, port 3001 server(thinserver1).
6) Maybe the timeout is from the proxy, but i change the timeout as this page showed, it failed!
7) change the timeout of thin server: open redmine-3.3.0-0\apps\redmine\scripts\serviceinstall.bat, add -t 300。
8) as this page showed, we can set KeepAlive=On in the ProxyPass option. i didn't try.
9) the final resolution is as this page, add "ProxyTimeout 400" line to Bitnami\redmine-3.3.0-0\apps\redmine\conf\httpd-prefix.conf. The default value of ProxyTimeout is Timeout, the default Timeout is 60 , change the value to 400 seconds. the config file:
ProxyPass / balancer://redminecluster
ProxyPassReverse / balancer
RewriteEngine On
RewriteRule ^/(.*)$ balancer://redminecluster%{REQUEST_URI} [P,QSA,L]ProxyTimeout 400
<Proxy balancer://redminecluster>
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
</Proxy>Include "D:\App\Bitnami\redmine-3.3.0-0/apps/redmine/conf/httpd-app.conf"