我已经尝试了一天以上,让Nginx和Passenger为我的Rails应用程序工作,但是我得到的只是:Nginx的欢迎页面。 为什么?
我在默认位置/opt/Nginx安装了Nginx,如下所示:
# Install passenger gem $ gem install passenger # Install dependencies for Nginx/Passenger $ apt-get install libcurl4-openssl-dev # Compile it $ passenger-install-Nginx-module
而且(我认为) /opt/Nginx/conf/Nginx.conf文件的相关部分看起来像这样:
http { passenger_root /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.29; passenger_ruby /usr/local/rvm/wrappers/ruby-2.0.0-p353/ruby; server { listen 80; server_name www.my-domain.com; root /home/deploy/current/public; passenger_enabled on; location / { root html; index index.html index.htm; passenger_enabled on; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; passenger_enabled on; } ...
当我检查“根位置”(公共)时,我可以看到该应用程序在那里(它与Capistrano部署):
我如何重新编译Nginx
Nginx工作者在使用乘客时处理angular色
如何在Nginx中部署多个rails应用程序,并在根中部署一个应用程序?
Nginx 504网关超时
$ ls /home/deploy/current/public 404.html 422.html 500.html assets css favicon.ico js robots.txt system
…或1级起来:
$ ls /home/deploy/current app Capfile config.ru doc Gemfile.lock log public resque.pid script tmp assets_manifest.yml config db Gemfile lib LOG Rakefile REVISION test vendor
看着Rails的production.log,我可以看到,它从来没有超越编译资产:
$ tail -f /home/deploy/current/log/production.log Compiled page_specific/some_file_5.css (137ms) (pid 28316) Compiled page_specific/some_file_4.css (19ms) (pid 28316) Compiled page_specific/some_file_3.css (3ms) (pid 28316) Compiled page_specific/some_file_2.css (3ms) (pid 28316) Compiled page_specific/some_file_1.css (16ms) (pid 28316) Compiled application.css (3131ms) (pid 28316)
看着Nginx的error.log,我看不到任何错误(正常访问URL(“主页”)似乎没有创build任何条目):
$ tail -f /opt/Nginx/logs/error.log
看看Nginx的access.log,我看不到任何错误(正常访问URL(“主页”)似乎没有创build任何条目):
$ tail -f /opt/Nginx/logs/error.log [ 2013-12-29 01:16:55.6792 2099/7fa534fca740 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
也:
我相信Nginx会考虑Nginx.conf文件(例如,如果取消注释#access_log logs/access.log main;而不注释#log_format main ,它会报错)
我在:Rails 3.2.16 / ruby 2.0.0p353 / Ubuntu 13.10
这里有什么可能是错的?
部署Rails 4 + Passenger + Nginx:奇怪的错误
删除:'/etc/apt/sources.list.d/passenger.list'
即使在重新启动后,我怎样才能保持乘客的独立性?
如何在Ubuntu上安装Phusion Passenger 4(在apache2或Nginx上)?
Rails应用程序和乘客的Nginx子域失败
圣洁。 所有这一切显然需要使其工作是:
注释/删除在安装过程中默认添加的“location /”指令:
# location / { # root html; # index index.html index.htm; # passenger_enabled on; # }
(如果有人知道为什么,我有兴趣知道。)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。