ruby-on-rails - 我的/public 目录可以是带有 rails 3 + 乘客 3 + nginx 0.8 的符号链接(symbolic link)吗?

标签 ruby-on-rails nginx passenger

我正在整理一个公共(public)目录是一个 Rails 部署
符号链接(symbolic link)到系统上的另一个目录。这是乘客 3 上
nginx .8。它似乎不喜欢这种设置。默认情况下,Nginx 始终遵循符号链接(symbolic link),因此 AFAIK 与 Apache 的 +FollowSymLinks 等效无关。

更新

看起来这里有介绍:http://www.modrails.com/documentation/Users%20guide%20Nginx.html#application_detection

Note that Phusion Passenger for Nginx does not resolve any symlinks in the root path. So for example, suppose that your root points to /home/www/example.com, which in turn is a symlink to /webapps/example.com/public. Phusion Passenger for Nginx will check for /home/www/config/environment.rb, not /webapps/example.com/config/environment.rb. This file of course doesn’t exist, and as a result Phusion Passenger will not activate itself for this virtual host, and you’ll most likely see some output generated by the Nginx default directory handler such as a Forbidden error message.

Detection of Rack applications happens through the same mechanism, exception that Phusion Passenger will look for config.ru instead of config/environment.rb.



所以我想知道 config.ru 的一些正确的符号链接(symbolic link)是否可以解决问题。

最佳答案

你不能使用以下内容:

mount --bind /original_path /your_ngnix_root_path

而不是使用符号链接(symbolic link)?对于 ngnix,这将是一个普通目录,为什么它会按照您的意愿指向另一个目录。

关于ruby-on-rails - 我的/public 目录可以是带有 rails 3 + 乘客 3 + nginx 0.8 的符号链接(symbolic link)吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4485349/

相关文章:

mysql - Rails 4 迁移不向现有数据库添加字段

ruby-on-rails - Rails - 嵌套表单不显示 - 在没有另一个 Controller 的情况下填充表格

ruby-on-rails - 有必要把Unicorn放在Nginx(或Apache)后面吗

ruby-on-rails - 乘客安装脚本报告成功但无法安装 Nginx

php5-fpm 完全忽略 redis ini 文件

mysql - 未配置生产数据库

sql - 使用 Rails 或 SQL 获取每个类别的最新记录

ruby-on-rails - 如何使用Nginx/Passenger服务多个站点?

ruby-on-rails - 生产服务器(nginx,passenger)上 2 个 ruby 的最佳解决方案

ruby-on-rails - rails : switch connection on each request but keep a connection pool