Question

"has been bloqued by CORS policy"

  • 19 December 2022
  • 5 replies
  • 162 views

Badge +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

Userlevel 4
Badge +13

👋

@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/"

🎁

Badge +1

@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.

Userlevel 4
Badge +13

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

Badge +1

@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.

Userlevel 4
Badge +13

🎉🎊🥳 👇

 

Reply