nginx 不承认 Passenger_root 选项

nginx 不承认 Passenger_root 选项

我在 Passenger 上运行 sinatra 应用,并尝试将其挂接到 nginx。我的配置的相关部分如下所示:

http {
    passenger_root /path/to/gem; #this is a valid path
    passenger_ruby /path/to/ruby; #ditto

    #etc...

    server {
        listen 80;
        server_name hello.org;
        root /path/to/stuff/public;
        passenger_enabled on;
    }
}

但是,每当我启动 nginx 时,我都会得到:

Starting nginx: [alert]: Phusion Passenger is disabled becasue the 'passenger_root' option is not set. Please set this option if you want to enable Phusion Passenger.

我这里遗漏了什么?谢谢!

答案1

我遇到了与 lowgain 相同的问题... 使用 rvm + nginx,我安装了 Passenger,然后重新编译了 nginx 以包含 Passenger 内容。不幸的是,旧版本位于 /etc/nginx,而新版本位于 /opt/nginx。

我必须通过 apt 删除 nginx:

sudo apt-get 删除 nginx

我还必须用新版本替换 /etc/init.d/nginx。完成所有这些操作后,它就可以正常工作了。

答案2

在我重建了带有 Passenger 支持的 nginx 之后,我安装了两次 nginx - bash 脚本仍然在从旧配置中读取!

相关内容