Adding a reverse proxy to a Kentico solution

Ryan Anthoney asked on July 18, 2019 14:55

Hi all,

I have a kentico application on my server as the default application. I want to add a reverse proxy to enable me to run another application at a specified URL prefix.

I have added the reverse proxy rewrite rule, tested the pattern which works but when I navigate to the URL it hits a 404 page. I've added the desired url to the list of excluded URL's in Settings > URLs and SEO section.

Is there anything else I'm missing?

Recent Answers


Dmitry Bastron answered on July 18, 2019 18:06

Hi Ryan,

Could you show your proxy rule? Does it include stopProcessing="true"?

0 votesVote for this answer Mark as a Correct answer

Ryan Anthoney answered on July 18, 2019 18:16

Hi Dmitry,

I've added the following rule to reverse proxy from www.example.com/explore (including any sub pages from there on) to www.new-example.com

<rule name="Reverse Proxy to Microsites" stopProcessing="true"> <match url="^explore/(.*)" /> <action type="Rewrite" url="http://www.new-example.com/{R:1}" /> </rule>

And I have added '/explore' and '/explore/' to the list of excluded URL's

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on July 18, 2019 19:12

Have you tried setting runAllManagedModulesForAllRequests in web.config?

<system.webServer>
...
  <modules runAllManagedModulesForAllRequests="true">

Also, do you have /explore page in your main website in Kentico tree?

0 votesVote for this answer Mark as a Correct answer

Ryan Anthoney answered on July 18, 2019 19:17

Hi Dmitry,

Yes the runAllManagedModulesForAllRequests setting you mentioned is in the webconfig.

/explore page is not in the main website Kentico tree but I have noticed there was a redirect in place for it.

If I use a different value than /explore (e.g. /test) the page loads but all the requests, css, js for example are looking at the origin domain. Is that right?

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on July 18, 2019 19:23

Do you have both of these in Excluded URLs?

/test;/test/
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.