Expand my Community achievements bar.

SOLVED

CDN proxy redirect using selectOrigin not working

Avatar

Level 8

Hi, 

I want to redirect my domain traffic to appbuilder project. I copy pasted the exact adobe example for origin selectors

 

 

 

kind: "CDN"
version: "1"
metadata:
  envTypes: ["dev"]
data:
  originSelectors:
    rules:
      - name: content-hub-portal
        when:
          allOf:
            - reqProperty: domain
              equals: "aem-dev-contenthub.example.com"
        action:
          type: selectOrigin
          originName: portal-live
    origins:
      - name: portal-live
        domain: 712524-contenthubportal-stage.adobeio-static.net

 

 

I expect upon hitting https://aem-dev-contenthub.example.com/ it would proxy redirect to app builder. But it is always hitting AEM dispatcher. 

 

Any hint how to troubleshoot cdn pipelines? How to debug why this redirect is not working as expected?

 

Can you please share a working cdn.yaml config file where you implemented selectOrigin and it worked?

 

Edit:

I referred to this post and changed the config like this, still same result, traffic always hitting publisher and not redirecting to appbuilder. I can confirm appbuilder works from browser. just cdn.yaml is not redirecting traffic. 

kind: "CDN"
version: "1"
metadata:
  envTypes: ["dev"]
data:
  originSelectors:
    rules:
      - name: staging
        when: { reqProperty: domain, like: aem-dev-contenthub.example.com }
        action:
          type: selectOrigin
          originName: mysite-staging-url
    origins:
      - name: mysite-staging-url
        domain: 712524-contenthubportal-stage.adobeio-static.net
        forwardHost: false

 

If anyone got your selectOrigin working successfully? can you please share the config yaml?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi @sarav_prakash,

I give it a try and the origin selection feature is working fine for me. Maybe compare your code with this example:

 

originSelectors:
    rules:
      # Route requests to /webhp to www.google.com domain
      - name: "origin-google-com"
        when:
          allOf:
            - reqProperty: tier
              equals: "publish"
            - reqProperty: path
              equals: "/webhp"
        action:
          type: selectOrigin
          originName: google-com
origins:
    - name: google-com
      domain: www.google.com

 

 

Good luck,

Daniel

View solution in original post

3 Replies

Avatar

Administrator

@EstebanBustamante @aanchal-sikka @narendragandhi @somen-sarkar @ayush-804 @kapil_rajoria @Sady_Rifat @Nishanth_KR @madalavenkat7 Would appreciate it if you could check out this question and share any insights you might have!



Kautuk Sahni

Avatar

Correct answer by
Level 10

Hi @sarav_prakash,

I give it a try and the origin selection feature is working fine for me. Maybe compare your code with this example:

 

originSelectors:
    rules:
      # Route requests to /webhp to www.google.com domain
      - name: "origin-google-com"
        when:
          allOf:
            - reqProperty: tier
              equals: "publish"
            - reqProperty: path
              equals: "/webhp"
        action:
          type: selectOrigin
          originName: google-com
origins:
    - name: google-com
      domain: www.google.com

 

 

Good luck,

Daniel

Avatar

Level 8

thanks. actually its same as adobe documentation. 

 

Seems there are 2 documentations to configure cdn.yaml. I followed second document. But missed to mark the /config folder in pipeline which was explained in first documentation.

 

https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/security/traffic-f...

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/confi...

 

 

So this is not the yaml code error. instead I was missing to include the /config folder  into the pipeline. When I created new pipeline and added /config, it started working. Thanks for looking though.