heroku: set SSL certificates on Free Plan?

前端 未结 8 835
遇见更好的自我
遇见更好的自我 2020-12-24 13:20

I would like to set some SSL certificates for one app I have on heroku (a simple application based on nodeJS + Vue).

I know if I upgrade to the Hobby Plan (7$ for mo

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-24 14:14

    Here I have a better approach to deal with this. As Heroku Doesn't provide SSL for Free Plan. But You can use Cloudflare which gives free SSL. You can Use Cloudflare As Bridge For SSL.

    Requirement: 1. Cloudflare Account 2. Your Application should not have inbuild SSL redirection (like redirect-ssl) Otherwise, This will result in Too Many Redirect Error

    Step 1: Point Your domain to CloudFlare. You basically open an account an enter your domain when prompted. You may be given instructions to change your domain name servers.

    Step 2: Add Cname Record of Heroku Server in DNS of Cloudflare. Instructions are here Here You will get Some SSL Security Issue.

    Step 3: Now Change Your SSL/TLS encryption mode to Flexible (Not Full). *Important

    Now Understand the Working:-

    Client(Browser) Make Request to https://example.com First, the request reaches the Cloudflare with SSL. (User see encrypted connection to the server.)

    Then Cloudflare makes request to Heroku Server(Origin) with Non-SSL (Non-Https and Unencrypted).

    Then Heroku Server (Origin) returns the Response with Non-SSL to Cloudflare.

    At the end Cloudflare forward the request to Client (Browser.)


    I have tested this method and working on https://www.foneman.in

提交回复
热议问题