{"id":890,"date":"2019-11-10T22:02:19","date_gmt":"2019-11-10T20:02:19","guid":{"rendered":"http:\/\/www.rocworks.at\/wordpress\/?p=890"},"modified":"2019-11-10T22:03:05","modified_gmt":"2019-11-10T20:03:05","slug":"iis-reverse-proxy","status":"publish","type":"post","link":"https:\/\/www.rocworks.at\/wordpress\/?p=890","title":{"rendered":"IIS Reverse Proxy Configuration"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you need to add a reverse proxy to your Internet Information Server (IIS) you can just add a rule to your site configuration file. In the following example we add a reverse proxy (url rewrite) for a GraphQL Server to our WinCC Unified WebRH. Afterwards restart the site with the IIS services manager.<\/p>\n\n\n\n<pre class=\"wp-block-verse\">IIS Configuration File: <br>\"C:\\Program Files\\Siemens\\Automation\\WinCCUnified\\SimaticUA\\web.config\"<br> <br> &lt;configuration&gt;<br> &nbsp; &lt;system.webServer&gt;<br> &nbsp; &nbsp; &lt;rewrite&gt;<br> &nbsp; &nbsp; &nbsp; &lt;outboundRules&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &lt;rule name=\"Remove Server header\"&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;match serverVariable=\"RESPONSE_Server\" pattern=\".+\" \/&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;action type=\"Rewrite\" value=\"\" \/&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/rule&gt;<br> &nbsp; &nbsp; &nbsp; &lt;\/outboundRules&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;rules&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong> &lt;rule name=\"Reverse Proxy to GraphQL\" stopProcessing=\"true\"&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;match url=\"^graphql\" \/&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;action type=\"Rewrite\" url=\"http:\/\/localhost:4000\/graphql\" \/&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/rule&gt; &nbsp; &nbsp; &nbsp; <\/strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;rule name=\"UMC SSO Static\"&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;match url=\"(.*)\" \/&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;conditions&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;add input=\"{URL}\" pattern=\"(.*)\\\/umc-sso(.*)\" \/&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/conditions&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;serverVariables&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;set name=\"HTTP_COOKIE\" value=\"{HTTP_COOKIE};ReverseProxyHost={HTTP_HOST};ReverseProxyPort={SERVER_PORT}\" \/&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/serverVariables&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;action type=\"Rewrite\" url=\"http:\/\/localhost:8443\/umc-sso{C:2}\" \/&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/rule&gt; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/rules&gt;<br> &nbsp; &nbsp; &lt;\/rewrite&gt; <br>...<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">More examples for rewrite rules<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;rewrite>\n    &lt;rules>\n        &lt;rule name=\"Reverse Proxy to webmail\" stopProcessing=\"true\">\n            &lt;match url=\"^webmail\/(.*)\" \/>\n            &lt;action type=\"Rewrite\" url=\"http:\/\/localhost:8081\/{R:1}\" \/>\n        &lt;\/rule>\n        &lt;rule name=\"Reverse Proxy to payroll\" stopProcessing=\"true\">\n            &lt;match url=\"^payroll\/(.*)\" \/>\n            &lt;action type=\"Rewrite\" url=\"http:\/\/localhost:8082\/{R:1}\" \/>\n        &lt;\/rule>\n    &lt;\/rules>\n&lt;\/rewrite><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart site with &#8220;Internet Information Services (IIS) Manager&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"935\" height=\"591\" src=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2019\/11\/Bildschirmfoto-2019-11-10-um-20.55.25.png\" alt=\"\" class=\"wp-image-894\" srcset=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2019\/11\/Bildschirmfoto-2019-11-10-um-20.55.25.png 935w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2019\/11\/Bildschirmfoto-2019-11-10-um-20.55.25-300x190.png 300w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2019\/11\/Bildschirmfoto-2019-11-10-um-20.55.25-768x485.png 768w\" sizes=\"auto, (max-width: 935px) 100vw, 935px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you need to add a reverse proxy to your Internet Information Server (IIS) you can just add a rule to your site configuration file. In the following example we add a reverse proxy (url rewrite) for a GraphQL Server &hellip; <a href=\"https:\/\/www.rocworks.at\/wordpress\/?p=890\">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":[33],"tags":[],"class_list":["post-890","post","type-post","status-publish","format-standard","hentry","category-wincc-unified"],"_links":{"self":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/890","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=890"}],"version-history":[{"count":6,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/890\/revisions"}],"predecessor-version":[{"id":897,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/890\/revisions\/897"}],"wp:attachment":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}