webrick使用ssl做什么?

Fel*_*lix 0 ssl ruby-on-rails webrick

我有一个rails 4应用程序,我想在webrick上使用SSL运行它.我需要做什么?

我已经为这个域和startet添加了ssl证书

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

现在我收到了这个错误:

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
Run Code Online (Sandbox Code Playgroud)

谢谢

为Apache HTTPS设置的指令

ProxyPreserveHost On
ProxyRequests On
ServerName domain.de
ServerAlias *.domain.de
ProxyPass / https://subdomain.domain.de:3001/
ProxyPassReverse / https://subdomain.domain.de:3001/
SSLEngine on
Run Code Online (Sandbox Code Playgroud)

Pau*_*rth 5

大多数人通过从webrick转换为thin(甚至更好,unicorn/puma/passenger)来解决这个问题.我认为webrick不是为了在生产中运行而设计的.

您也可以在apache处终止SSL,以便webrick仅处理http.(另外,假设Apache在同一个盒子上运行,你不需要绑定0.0.0.0.Ontributehost会这样做,绑定到外部IP听起来像一个安全漏洞.)

如果你真的想保持webrick并让它处理SSL,你可以bin/rails按照其他答案中的描述进行更改.