4

I'm new to nginx and am attempting 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 passenger-install-nginx script on an ARMv5te system in Arch Linux ARM.

I am getting the following in the nginx log: (Note: I've removed the server name from the logs/configs)

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 consistently whenever I do an HTTP POST on any page in redmine. HTTP GET requests work fine with pages rendered.

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-enabled/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 - I can run redmine fine if I use the built in ruby webrick server, so I'm guessing this is likely to be an nginx/passenger problem. Has anyone got any idea what the issue is?

4

5 回答 5

0

可能是Passenger ContentHandler.c 中的一个错误,对off_t 值执行“%ui”转换。简而言之,找到线

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

在 ContentHandler.c 中并将其替换为

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

更多细节在这里:

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

于 2014-07-13T03:24:18.787 回答
0

Looks like this problem is tied to arm platform.

I got the same problem on arm, but same code and configuration works fine on x86.

于 2013-05-30T02:35:13.860 回答
0

有同样的问题。乘客说:

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

但是我的一个使用相同系统(树莓派)的朋友没有问题。比较已安装的软件包,我们发现唯一的差异是Passenger 的版本。

4.0.10 与 3.0.19。

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

在降级 gem 并用乘客重建 nginx 后 - 问题解决了。POST 请求不会脱落并正常工作。

于 2013-08-15T08:59:37.417 回答
-1

这些天没有

gem remove

只需安装 3 0 19

并在之后检查版本

passenger --version

好的 - 看起来我们必须删除 v 4

gem uninstall ....

pas --ver

现在是 v 3

于 2013-10-09T01:59:15.003 回答
-1

在 Apache 中,您必须设置 ruby​​ 和 passengee 配置,如本文http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger中所述

如果您不这样做,您会在发布时收到服务器错误。我可以想象你必须在你的 nginx 中设置类似的东西

于 2013-05-12T09:28:29.977 回答