我正在整理一个公共(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/