Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

For the docker/sdk their is an option to set CORS: ``` fastcgi_param SPRYKER_GLUE_APPLICATION_CORS_A

Options
UPF4FKAQ0
UPF4FKAQ0 Posts: 29 🧑🏻‍🚀 - Cadet

For the docker/sdk their is an option to set CORS:


But when i have an external frontend for example in a Azure CDN i get the following message:
No 'Access-Control-Allow-Origin' header is present on the requested resource.

Comments

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Please add the following in config/Shared/config_default-docker.php


  • UPF4FKAQ0
    UPF4FKAQ0 Posts: 29 🧑🏻‍🚀 - Cadet
    Options

    I already add this line in the docker conf, but the error still exists.

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Can you check manually in response headers?

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    But anyway I would prefer to setup CORS on proxy level, not on app level.

  • UPF4FKAQ0
    UPF4FKAQ0 Posts: 29 🧑🏻‍🚀 - Cadet
    Options

    Ok i will check the headers, but I totally agree with you to set the CORS on proxy level

  • UPF4FKAQ0
    UPF4FKAQ0 Posts: 29 🧑🏻‍🚀 - Cadet
    edited November 2019
    Options

    Ok so i remove the SPRYKER_GLUE_APPLICATION_CORS_ALLOW_ORIGIN and set the header in the nginx with


    Now im getting the following error, is there any "magic" in spryker were the application is trying to set this header?


  • UK5DS29L2
    UK5DS29L2 Posts: 546 🧑🏻‍🚀 - Cadet
    Options

    should be


  • UPF4FKAQ0
    UPF4FKAQ0 Posts: 29 🧑🏻‍🚀 - Cadet
    Options

    unfortunately there is no set_header option for nginx

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options
  • UK5DS29L2
    UK5DS29L2 Posts: 546 🧑🏻‍🚀 - Cadet
    Options

    ah crap indeed it was about proxy, my bad

  • UPF4FKAQ0
    UPF4FKAQ0 Posts: 29 🧑🏻‍🚀 - Cadet
    Options

    no problem, i didn't get it, when i follow the idea from @ULYHPR789 i get multiple values, so i decide to role all configs back and remove the SPRYKER_GLUE_APPLICATION_CORS_ALLOW_ORIGIN from the code, now im getting this:


    For now, i think i remove all rhe origins modification from our config or code and spryker still get some from wherever