[OpenLayers-Users] Using Proxy Host?

christopher.schmidt at nokia.com christopher.schmidt at nokia.com
Tue Jun 1 14:17:13 EDT 2010


On Jun 1, 2010, at 2:08 PM, ext Ryan Williams wrote:

> Hi all,
> 
> I know similar questions have been asked, but after searching for most 
> of the morning I have yet to find an answer that I can get to work.
> 
> I'm trying to make this work: Geoserver 2.0-SNAPSHOT is on one server 
> with it's own domain; Our web server is on a different server in a 
> different domain.
> My page is html with OpenLayers 2.9 and other JavaScript and it is 
> served up by the web server (call it dev.mapping.com/maps.html).
> I'm able to display map images and legends from Geoserver and 
> GeoWebCache, but when I attempt a WMS GetFeatureInfo request I receive a 
> blank popup and firefox reports: "401 Full Authentication is required to 
> access this resource"
> 
> Now, I think this is due to the 'Same Origin Policy' and I may be able 
> to setup a proxy to get around this.

This is incorrect. A 401 error is not issued because of a Same Origin Policy
violation. Instead, the request will simply not work/cause an error.

Possibly, this is happening because the relative resource to dev.mapping.com
is actually protected: If you're requesting "/foo/wms/bar", and the URL
on dev.mapping.com is protected by some kind of auth, that could be your
problem, but without seeing your code I can't really imagine how this would
be without you knowing it.

> So, is this a situation where adding "dev.mapping.com" to the permitted 
> hostnames in the Geoserver Proxy Administration UI should make this work?

Generally, GeoServer would only be able to proxy requests *out* from
geoserver.example.com -- not requests from remote.example.com *to*
geoserver.example.com. So unless something special is going on here that
I can't picture, I don' think so.

> Do I need to be setting the OpenLayers.ProxyHost variable?

Probably.

> (I realize 
> this is an OpenLayers question)
> Is this something that needs to be setup on the web server instead?

The web server that is serving your HTML pages, yes.

> I've tried adding the hostname to the permitted hostnames in the 
> Geoserver UI and haven't seen any changes. Am I completely 
> misunderstanding what this proxy config is for?

I have never used GeoServer, but I think the answer is still yes.

Regards,
-- 
Christopher Schmidt
Nokia




More information about the Users mailing list