ruby-on-rails – 我的/ public目录可以是rails 3 passenger 3 nginx 0.8的符号链接吗?

我正在组建一个公共目录所在的rails部署
符号链接到系统上的另一个目录.这是乘客3
nginx .8.它似乎不喜欢这种设置.默认情况下,Nginx总是遵循符号链接,所以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.

所以我想知道是否有一些正确的配置符号可以解决这个问题.

解决方法

我认为不可能使用符号链接的公共目录.我能想象的唯一解决方法是对公共目录中的任何文件和目录进行符号链接.
# public folder: /data/public
# app folder: /webapp/
mkdir -p /webapp/public && ln -sf /data/public/* /webapp/public/

对于/ data / public中的每个新文件或目录,您必须再次运行此命令.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...