Saturday, March 24, 2012

Atlas through apache proxy

Hi

I'm hosting pages on apache, and I need access to asp.net2 pages hosted on another server. To expose only one server on the net, I decided to show my apache server, and use a virtual directory as proxy to the iis server, with somethink like this :
http://www.codeproject.com/aspnet/cassini_apache_101.asp

The thing works well, but not atlas...
I'm explaining :
Apache is configured to redirect /iis/* requests to the IIS server as /*
I'm using a sample empty page to test atlas (update panel containing 1 button, 1 textbox and 1 label, with an updateprogress).
The page works well, without any atlas objects.
When adding atlas, the proxied page doesn't work (javascript error).
When reading the source, I see a script with this url :

<script src="http://pics.10026.com/?src=/testatlas/WebResource.axd?d=V3h7lAaHQGE9jJRzRQZIfy1AxfEQzTtQmmpxyF4UrKQxRFNElU1QoINPfX3GmTiJpZAHIiXxweeRrf8WfQuZZjp6nneIqCzcGcWwa4A2zOk1&t=632799255520000000" type="text/javascript">
The url is bad. Let's look a the calls made at each step :
My browser is requesting http://server/iis/page.aspx
Apache proxy is handling this request, and makes a request http://iis/page.aspx
The response is returned to the browser.

So all the path infos are returned relative to the request made by the proxy, and not rewritten when the response is returned.

One solution can be to specify relative url from the page (with enough ../ ) to go to the root, and not relative url from root.

Does anyone know if there is another solution ?

I suggest that you look at the following post:

http://forums.asp.net/2/1248767/ShowThread.aspx

You can use the technique mentioned by mharder to override the Atlas scripts path, so that instead of using the web resource it uses Atlas scripts from the location you specify.

No comments:

Post a Comment