Skip to main content
Question

"has been bloqued by CORS policy"

  • December 19, 2022
  • 5 replies
  • 371 views

Forum|alt.badge.img+1

I would like to display some information from my Centreon on an HTML page, but an error persists in my browser console. Here is the error and my JavaScript code.

 

 

5 replies

ponchoh
Centreonian
Forum|alt.badge.img+14
  • Centreonian
  • December 19, 2022

👋

@Dorian have you updated your “/etc/httpd/conf.d/10-centreon.conf” to include the allowed sites and that they match your security policies. Adjust “your.url.com” as needed

 

    Header  set X-Frame-Options: "ALLOW-FROM http://your.url.com/"

🎁


Forum|alt.badge.img+1
  • Author
  • Steward *
  • December 20, 2022

@ponchoh I don't have the file '10-centreon.conf' in my '/etc/httpd/conf.d' directory tree. Do I need to create it or is it located in another folder? I am working on a configuration that I am not the owner of and the WEB interface is already in HTTPS.


ponchoh
Centreonian
Forum|alt.badge.img+14
  • Centreonian
  • December 20, 2022

In this case probably ask the admin/owner as they have to decide the CORS policy


Forum|alt.badge.img+1
  • Author
  • Steward *
  • December 20, 2022

@ponchoh I did a "find" in "/" and found a path that matches what you suggested:

I added the line you specified:
Header set X-Frame-Options: "ALLOW-FROM http://192.168.100.40/"
However, it doesn't work and I don't understand why I can access the WEB interface but not the API.
I asked the Admin/Owner but they don't know any more than I do.


ponchoh
Centreonian
Forum|alt.badge.img+14
  • Centreonian
  • January 5, 2023

🎉🎊🥳 👇