How can I pass SSL options into “rails server” in Rails 3.0?

后端 未结 2 754
闹比i
闹比i 2020-12-18 04:18

Is there a way to pass SSL options into \"rails server\" (on Rails 3.0.0), using a custom Rack config or something similar? I\'m trying to do two things:

  1. enab
2条回答
  •  臣服心动
    2020-12-18 04:55

    Take a look at the Thin server in place of WEBrick. There are so many benefits of using Thin that I can't list them all here, but it should address your issue since it supports SSL.

    When starting thin, pass the following options:

    SSL options:
        --ssl                        Enables SSL
        --ssl-key-file PATH          Path to private key
        --ssl-cert-file PATH         Path to certificate
        --ssl-verify                 Enables SSL certificate verification
    

    In production, you will ideally want to handle SSL at the Nginx or Apache layer, but this should handle your development requirements.

提交回复
热议问题