加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 我的/ public目录可以是rails 3 passenger 3 n

发布时间:2020-12-16 23:35:28 所属栏目:百科 来源:网络整理
导读:我正在组建一个公共目录所在的rails部署 符号链接到系统上的另一个目录.这是乘客3 nginx .8.它似乎不喜欢这种设置.默认情况下,Nginx总是遵循符号链接,所以AFAIK不是做与Apache的FollowSymLinks等效的事情. 更新 看起来这里有这个:http://www.modrails.com/d
我正在组建一个公共目录所在的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中的每个新文件或目录,您必须再次运行此命令.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读