[OpenLayers-Users] openMNND demo

Chris Tweedie chrislist at narx.net
Wed Apr 18 08:02:25 EDT 2007


Hey Brad,

Since it seems you have full control over your Apache install, simply enable mod_proxy + mod_rewrite, create a corresponding .htaccess file and drop in the following

RewriteEngine on
RewriteRule ^\/proxy\/(.*)$ http://brad.remote.wfs.com/server/$1 [P]

The simple test is to try something like,

http://localhost/proxy/wfs?Service=wfs&Version=1.1.1&Request=GetCapabilities

just to check that everything is being proxied correctly. The above url should be rewritten internally as

http://brad.remote.wfs.com/server/wfs?Service=wfs&Version=1.1.1&Request=GetCapabilities

Assuming its all a'ok, you wont need to set OpenLayers.Proxyhost because as Chris(x2) pointed out, from the browser's perspective its not cross-domain. If you have more than one WFS you want to use, simply duplicate the lines and add a new proxy path + server. You've effectively just created your own reverse proxy in 2 lines ..

Chris

On Wed, 18 Apr 2007 07:24:11 -0400, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> On Wed, Apr 18, 2007 at 02:37:38PM +1000, bradleyspencer wrote:
>> Christopher,
>>
>> Assuming I get Apache set up correctly with a forward Proxy, what should
> I
>> put in the OL ProxyHost variable?
>>
>> OpenLayers.ProxyHost="/modules/mod_proxy.so?url=";
>>
>> Its still not clear to me what happens inside OL?
>
> Assuming you get a proxy set up, such that
> http://mysite.com/remotewfsserver/ points to
> http://example.com/cgi-bin/mapserv -- you don't *need* to do anything
> anymore, because as far as the browser is concerned, the URL
> mysite.com/remotewfsserver is running under the same domain. (Remember,
> all that matters is what the browser thinks it is talking to.)
>
> So, once cubewerx.something/remotewfs?request=GetCapabilities, make your
> WFS layer point to cubewerx.something/remotewfs, and you won't need
> a proxy anymore.
>
> Regards,
>
--
Chris Tweedie
--
Chris Tweedie




More information about the Users mailing list