【问题标题】:How to serve using Passenger running with SSL如何使用通过 SSL 运行的乘客服务
【发布时间】:2016-06-17 21:13:38
【问题描述】:

我有一个 Rails 4 应用程序,我想通过 SSL 在Passenger 上运行它。

我将Passenger gem 添加到gemfile 并使用以下命令运行服务器:

 bundle exec rails s -e production -p 3001 --binding=0.0.0.0

在设置中我设置了ssl = true,它有效。推荐使用 SSL,服务器希望使用 HTTPS 调用应用程序。

当我像这样为 HTTPS 端口 443 设置虚拟主机时:

ProxyPreserveHost On
ProxyRequests On
ServerName domain.de
ServerAlias *.domain.de
ProxyPass / https://subdomain.domain.de:3001/
ProxyPassReverse / https://subdomain.domain.de:3001/
SSLEngine on

我收到了这个错误:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at  to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache Server at domain.de Port 443

SSL 证书是通过 plesk 12.5 提供的。

在这种情况下有什么问题?我需要改变什么?

【问题讨论】:

  • 你在哪里配置了虚拟主机?看来您正在独立启动 rails 并在端口 3001 上使用 webrick,而不是在 apache 上使用乘客。
  • 我使用的是独立的 passanger,而不是 webrick。我必须在 apache 上运行 Passanger 吗?虚拟主机设置在 Plesk 那里您可以设置虚拟主机设置
  • 我已经做到了,就像这里提到的那样:phusionpassenger.com/library/walkthroughs/start/ruby.html
  • 它现在使用 SSL 运行,但和 apache 的乘客......但 http 版本也能正常工作......我如何设置 http 总是转向 http
  • 问题解决了!它现在与 passanger 一起运行!

标签: ruby-on-rails ruby ruby-on-rails-4 passenger


【解决方案1】:

更好更简单的方法是使用 passangermodule 为 apache 或 nginx

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多