I have a GeoServer WMS in Apache-Tomcat at http://localhost:8080 and a mod_wsgi app in standard Apache at http://localhost:80/myapp.
My OpenLayers map is being hosted statically by the Apache-Tomcat Geoserver app at http://localhost:8080/geoserver/www/OL.html. The JavaScript in this map has to call the mod_wsgi app for non geographic data.
I've tried setting up a proxy in GeoServer the following ways
http://localhost:80/mypp
http://localhost
localhost
None of these work. After making a request some of my response object attributes look like this which means it's not really working. GeoServer logs show no errors
priority "NORMAL"
readyState 4
responseText ""
responseXM Lnull
status 0
statusText ""
Can't say I'm too much of an expert at Proxies. But it seems to me that I wouldn't need to set up a OpenLayers proxy (as mentioned here) if GeoServer can proxy for me.
Ideas, hints, advice?
-
1well, it seems that the obvious 'text/plain' mimetype was the cause of the issue. Once i added this and changed my Proxy to localhost:80 then everything worked. For future people seeing this post i tested it using JQuery. The GET request looks like this $.get("/geoserver/rest/proxy?url=localhost:80/myapp", {format : 'text/plain'}, function(data){console.log(data); })maztaz– maztaz2012年02月01日 15:41:52 +00:00Commented Feb 1, 2012 at 15:41
-
might be best to paste that comment in as an answer below, for ease of finding for the next personIan Turton– Ian Turton2012年02月01日 17:30:40 +00:00Commented Feb 1, 2012 at 17:30
-
@iant -- thanks for the suggestion and your previous help. Though I guess because of my "point" status i can't do it for another few hours ;-(maztaz– maztaz2012年02月01日 19:14:01 +00:00Commented Feb 1, 2012 at 19:14
1 Answer 1
well, it seems that the obvious was at play here. The 'text/plain' mimetype was the cause of the issue. Once i added this to GeoServer's proxy mimetypes and changed my proxy to be "localhost:80" then everything worked.
For future people seeing this post i tested it using JQuery. The GET request looks like this:
$.get("/geoserver/rest/proxy?url=localhost:80/myapp";, {format : 'text/plain'}, function(data){console.log(data); })