Dgahagan
Dgahagan

Reputation: 43

Forward request to virtual directory to an internal web server using IIS7 URL Rewrite

I have an IIS server that is currently only accessible internally to our network and I would like to be able to access some files on it via a folder on our public website.

I would like it to work like the following:

Here is the steps I have taken to do this:

  1. I created a virtual folder in the root of our public website named "server1"
  2. I then selected URL Rewrite in the IIS manager on this new virtual folder
  3. I then created the rule as shown below:

enter image description here

I am currently recieveing a 404 error when I try to access a file at: http://www.example-1.com/server2/test.jpg

I can verify the file is there by remoteing into web server one and browsing to: http://www.example-2/test.jpg This shows the test image.

I feel the problem must somehow be related to my URL rewrite rule.

If someone could offer advice on this issue I would greatly appreciate it as I have never used the URL Rewrite module before. Thank you!

Upvotes: 1

Views: 1104

Answers (1)

Dgahagan
Dgahagan

Reputation: 43

I have found the solution!

I was very close but I made a key mistake...

Instead of using a Blank Rule I needed to use a "Reverse Proxy" rule in IIS 7 URL Rewriting.

I created this Reverse Proxy rule on the /server2/ folder. enter image description here

This works perfectly!

Upvotes: 0

Related Questions