Redmine 2.3, ruby ​​2.0.0, nginx 1.4.1 with passenger 4.0.2 all HTTP POSTs do not work

I am new to nginx and trying to run Redmine 2.3 using ruby ​​2.0.0, phusion passenger 4.0.2 and nginx 1.4.1. This is compiled from the patch-install-nginx script on the ARMv5te system in Arch Linux ARM.

In nginx log I get the following: (Note: I removed the server name from / configs logs)

2013/05/08 23:41:12 [notice] 1359#0: signal process started [ 2013-05-08 23:41:13.1325 1367/b6f9a000 agents/HelperAgent/Main.cpp:554 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.1363/generation-0/request.socket [ 2013-05-08 23:41:13.2641 1387/b6f26000 agents/HelperAgent/Main.cpp:554 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.1381/generation-0/request.socket [ 2013-05-08 23:41:13.3028 1392/b6faa000 agents/LoggingAgent/Main.cpp:272 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.1381/generation-0/logging.socket [ 2013-05-08 23:41:15.9700 1387/b59ff450 Pool2/Spawner.h:739 ]: [App 1408 stdout] [ 2013-05-08 23:41:43.5820 1387/b6b4a450 Pool2/Spawner.h:159 ]: [App 1408 stderr] /var/www/sites/public-redmine-2.3/lib/SVG/Graph/Graph.rb:3: warning: class variable access from toplevel [ 2013-05-08 23:41:55.8491 1387/b59ff450 Pool2/Spawner.h:739 ]: [App 1439 stdout] [ 2013-05-08 23:44:15.2842 1387/b57ff450 agents/HelperAgent/RequestHandler.h:581 ]: [Client 20] Disconnecting with error: invalid SCGI header 2013/05/08 23:44:15 [error] 1402#0: *3 upstream prematurely closed connection while reading response header from upstream, client: 192.168.4.254, server: (removed), request: "POST /login HTTP/1.1", upstream: "passenger:/tmp/passenger.1.0.1381/generation-0/request.socket:", host: "(removed)", referrer: "http://(removed)/login" 

The last error occurs constantly when I do an HTTP POST on any page in redmine. HTTP GET requests work fine with displayed pages.

nginx.conf

 worker_processes 2; events { worker_connections 1024; } http { passenger_root /usr/lib/ruby/gems/2.0.0/gems/passenger-4.0.2; passenger_ruby /usr/bin/ruby; passenger_max_pool_size 2; passenger_pool_idle_time 120; passenger_pre_start http://(removed)/; passenger_spawn_method smart; include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; location / { root html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } include sites-enabled/*.conf; } 

sites with support for /redmine.conf

 server { listen *:80; server_name (removed); passenger_enabled on; rails_env production; passenger_spawn_method conservative; root /var/www/sites/kamikaze-kb/public; location /plugin_assets/ { root /var/www/sites/kamikaze-kb/public/plugin_assets/; } } 

One thing that may be relevant is that I can run redmine perfectly if I use the ruby ​​webrick built-in server, so I guess this is probably a nginx / passenger issue. Has anyone understood what the problem is?

+4
source share
5 answers

This issue seems to be related to the hand platform.

I have the same problem on hand, but the same code and configuration work fine on x86.

0
source

There was the same problem. Passenger says:

 [Client 20] New client accepted; new client count = 1 [Client 20] Disconnecting with error: invalid SCGI header [Client 20] Disconnected; new client count = 0 

But my friend with the same system (raspberry pi) has no problem. Comparing the installed packages, we found out that the only discrepancy was the version of Passenger.

4.0.10 vs 3.0.19.

 sudo gem remove passenger -v "=4.0.10" sudo gem install passenger -v "=3.0.19" sudo passenger-install-nginx-module 

After lowering the gem and restoring nginx with the passenger - the problem is resolved. POST requests do not fall off and work fine.

0
source

There is probably an error in Passenger ContentHandler.c converting "% ui" to off_t. In short, find the line

 b->last = ngx_snprintf(b->last, 10, "%ui", r->headers_in.content_length_n); 

in ContentHandler.c and replace it with

 b->last = ngx_snprintf(b->last, 10, "%O", r->headers_in.content_length_n); 

More details here:

https://github.com/phusion/passenger/issues/1151

0
source

On Apache you need to set ruby ​​and passengee configurations as described in this article http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger

If you do not, you will receive server errors in the message. I can imagine that you need to install something like this in your nginx

-1
source

these days no

 gem remove 

just set 3 0 19

and check the version after

 passenger --version 

ok - it looks like we should remove v 4

 gem uninstall .... pas --ver 

now v 3

-1
source

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


All Articles