How to setup a reverse proxy via Cloudfront?

Note: always replace “client.com” with your hostname, “client.backend.verbolia.com” with the given verbolia hostname and “/path_to_verbolia/” with the agreed routed url pattern.

  • Go to Amazon Cloudfront Service management page and click the Distribution ID:

6c336731-dd4c-4fab-8f41-899de9c4c8a6

  • Click the Origins tab: 

         cf74cafe-bf63-47e9-baab-f45732694bc8

  • Choose Create Origin: 

       

Origin Domain Name = client.backend.verbolia.com

40996c58-4a4d-4ec5-a374-d63194852389

  • Then click on Behaviors tab and Create Behavior:       

          cc159cb8-deba-4b50-b457-135d4e1d3e34

        

Path pattern is “/path_to_verbolia/*
Origin is “custom-client.backend.verbolia.com”
Cache Policy must be “CachingDisabled”

c424cff7-ba5b-4c9f-98ab-42a2aef4ce8c

  • Before Clicking to “Create behaviour”, under Origin request policy, create a new policy:

d5c201cb-e9b2-4cb1-8572-72262a993b40

Choose a name “UserAgentRefererHeaders”, Description “Policy to forward User-Agent and Referer headers to origin”

Under Origin request settings, select “Include the following headers” and add “Referer” header from the pre-defined list and add custom “user-agent” header.

Select “All” for “Query strings” and “Cookies” settings. and click create.

f70f23b0-0dc1-40e8-a788-097cd2b7c600

  • Finally, select the newly created Origin request policy in the Create behavior definition and click “create behavior”

227b5fc1-9abd-4599-91a6-641a130751af