What does force_ssl do in Rails?

前端 未结 4 1481
温柔的废话
温柔的废话 2020-11-28 05:09

In a previous question I found out that I should be setting nginx ssl termination and not having Rails process encrypted data.

Then why does the following exist?

4条回答
  •  [愿得一人]
    2020-11-28 05:52

    This setting forces HTTPS by redirecting HTTP requests to their HTTPS counterparts. So a browser visiting http://domain.com/path will be redirected to https://domain.com/path.

    Leaving the setting commented out would allow both protocols.

    You still have to configure your web server to handle HTTPS requests.

提交回复
热议问题