Configuring the SharePoint 3.0 RSS Reader to use a Proxy Server

Here's a problem I hit today - I was setting up an instance of Microsoft Office SharePoint Server 2007 (MOSS) on my customers' Intranet and I was adding an RSS Reader web-part. I configured this web part to pull the feed from an external Internet site, and the web-part couldn't read it. I tried pulling from a feed elsewhere on the Intranet, and it worked fine. Why couldn't the web part see outside? Then I remembered  - the customer uses a Proxy server on their intranet. So I needed to configure SharePoint to use a proxy server.

How?

Turns out that SharePoint doesn't have a setting for this (which is why an hour of searching administration pages didn't turn up anything <sigh> ) as it just uses a setting embedded in the .NET Framework itself. This setting is configured in a file called "web.config", located on my machine in the following directory:

C:\Inetpub\wwwroot\wss\VirtualDirectories\80

I found the one I wanted by opening the Computer Management applet in Control Panel, then under Applications and Services > Internet Information Server > Web Sites > SharePoint (80) and doing a "Browse". The last name ("SharePoint (80)") might vary for you depending on how you've configure you SharePoint installation.

Once I located and opened the web.config of the SharePoint site I wanted to put the RSS Reader applet into, I added this at the very end of the file ( inside the last tag (</configuration>)):

  <system.net>      <defaultProxy>         <proxy usesystemdefault = "false" proxyaddress="https://proxyservername" bypassonlocal="true" />      </defaultProxy>   </system.net> 

 

Obviously, "proxyservername" is whatever the fully qualified name of the Proxy Server on the local network is. You can also append a port if required, e.g. https://proxyservername:1234.

And that's it! You don't even need to restart anything, as IIS will automatically spot the change to web.config and automatically restart the relevant SharePoint site and incorporate the changes (so make sure there are no users on your SharePoint site in the middle of something when you make this change!)

If you have many sites on your SharePoint site, instead of changing every web.config you could instead change the machine.config once, located at %runtime install path%\Config directory, which on my machine was in C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\CONFIG. Just insert the code above at then end, inside the last tag (</configuration>). You need to reboot for this change to take effect, however but at least you only need to do it once :-)

One other thing to bear in mind is the security requirements of the proxy server (and my thanks to Selar for pointing this out) as MOSS has some limitations in this regard. You need to configure the proxy server to allow IP authentication from the Web Front End(s), as MOSS is incapable of passing NTLM credentials to the proxy server. There needs to be a rule on the proxy server allowing http and https requests from the IP address(s) of the web front ends but it should not require any credentials be passed along for these requests.