Reputation: 321
I have a simple website within a closed network, lets call it "Resitricted Site". Restricted Site has a few hyperlinks to other pages than the index where it displays logging information from different files.
I am trying to create an ASP.NET site that will be exposed to the outside world, but still be in the same network as Restricted Site. Lets call this site "Public Site".
In Public Site I need to forward all requests to Restricted Site and then show the response from Restricted Site. In other words, Public Site will act as a proxy to Restricted Site.
How can I achieve this in ASP.NET? If you have any simple code which you can share, please do.
What I have tried so far: I've tried creating an HttpHandler like this one (without luck): HttpHandler
Upvotes: 2
Views: 430
Reputation: 321
I ended up using two IIS extensions to do exactly what I wanted to.
I used these extensions: - Application Request Rerouting - URL Rewrite
You can search for "reverse proxy in IIS" and you will find lots of different articles on how to set it up.
Tip: In case you want to set it up on a site with e.g. a CMS in place. You can create a virtual directory in that site and setup the URL Rewrite rules for that virtual directory only.
Upvotes: 1