{"id":1373,"date":"2024-02-14T17:46:18","date_gmt":"2024-02-14T15:46:18","guid":{"rendered":"https:\/\/www.rocworks.at\/wordpress\/?p=1373"},"modified":"2024-02-14T18:05:02","modified_gmt":"2024-02-14T16:05:02","slug":"embed-grafana-in-wincc-unified","status":"publish","type":"post","link":"https:\/\/www.rocworks.at\/wordpress\/?p=1373","title":{"rendered":"Embed Grafana in WinCC Unified"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this scenario we will host Grafana over the IIS from WinCC Unified. So that it comes from the same origin and that we do not come over a CORS (Cross-Origin Request Blocked) problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What is needed to allow Grafana to be embedded in another application is to set allow_embedding = <strong>true<\/strong> in the Grafana configuration file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"809\" src=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-1024x809.png\" alt=\"\" class=\"wp-image-1377\" srcset=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-1024x809.png 1024w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-300x237.png 300w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-768x607.png 768w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-1536x1213.png 1536w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-2048x1618.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To host Grafana over the IIS the following settings must be made:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add a URL Rewrite to your IIS configuration file. Change &#8220;desktop-khlb071&#8221; to your computer where Grafana is running on. Restart the Webpage with the IIS Manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The IIS configuration file can be found here: (C:\\Program Files\\Siemens\\Automation\\WinCCUnified\\SimaticUA\\web.config)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                &lt;rule name=\"grafana\" enabled=\"true\" stopProcessing=\"false\"&gt;\n                    &lt;match url=\"grafana(\/)?(.*)\" ignoreCase=\"true\" \/&gt;\n                    &lt;action type=\"Rewrite\" url=\"http:\/\/<strong>desktop-khlb071<\/strong>:3000\/{R:0}\" appendQueryString=\"true\" logRewrittenUrl=\"false\" \/&gt;\n                &lt;\/rule&gt;      <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change the following configuration of Grafana (defaults.ini). Change the domain to your computer name where Grafana is running on. It must be the same name what you use in the IIS configuration file!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># The public facing domain name used to access grafana from a browser\ndomain = <strong>desktop-khlb071\n<\/strong>\n# Redirect to correct domain if host header does not match domain\n# Prevents DNS rebinding attacks\nenforce_domain = <strong>false\n<\/strong>\n# The full public facing url\nroot_url = %(protocol)s:\/\/%(domain)s:%(http_port)s\/<strong>grafana\n<\/strong>\n# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.\nserve_from_sub_path = <strong>true<\/strong>\n\n# set to true if you want to allow browsers to render Grafana in a &lt;frame&gt;, &lt;iframe&gt;, &lt;embed&gt; or &lt;object&gt;. default is false.\nallow_embedding = <strong>true<\/strong>\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this scenario we will host Grafana over the IIS from WinCC Unified. So that it comes from the same origin and that we do not come over a CORS (Cross-Origin Request Blocked) problem. What is needed to allow Grafana &hellip; <a href=\"https:\/\/www.rocworks.at\/wordpress\/?p=1373\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,33],"tags":[73,59,64],"class_list":["post-1373","post","type-post","status-publish","format-standard","hentry","category-allgemein","category-wincc-unified","tag-grafana","tag-scada","tag-winccunified"],"_links":{"self":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1373"}],"version-history":[{"count":4,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1373\/revisions"}],"predecessor-version":[{"id":1380,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1373\/revisions\/1380"}],"wp:attachment":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}