geoserver behind proxy

381 views
Skip to first unread message

Florent Gravin

unread,
Dec 4, 2012, 1:12:42 PM12/4/12
to georc...@googlegroups.com
Hi,

I have deployed georchestra and i have an issue with geoserver behind security-proxy.

I have geoserver-private.war, the entry in the proxy-servlet.xml of security-proxy redirects to geoserver-private :<entry key="geoserver" value="http://localhost:8080/geoserver-private/" />

But while accessing to http://georchestra/geoserver the navigator redirects me to georchestra/geoserver-private/web and send a 404.
If i go to georchestra/geoserver/web, then it is ok.

I put the proxybaseurl with no effect.

Anyone have an idea about this redirection ?

Ty

--
Florent Gravin
Camptocamp - Chambéry
0479444492

Pierre Mauduit

unread,
Dec 4, 2012, 1:31:30 PM12/4/12
to georc...@googlegroups.com
Hi,

> I put the proxybaseurl with no effect.
>
> Anyone have an idea about this redirection ?

Yes, and I think (but cannot remember exactly) that this is why c2c often chose
to put geoserver in its own tomcat, so that there was no problem redirecting
from the security proxy to a webapp simply called geoserver (without "-private"
suffix). Anyway, here is what I did to fix it into my nginx configuration[1]:

8<-------------------------------------------------------------------------

# little hack to fix geoserver redirections
# This may not be needed if geoserver is contained
# in its own tomcat (which implies that the -private
# suffix
# is not needed)
rewrite ^/geoserver-private/(.*)$ /geoserver/$1 permanent;

------------------------------------------------------------------------->8

I'm pretty sure you should be able to easily do the same with apache's
mod_rewrite.

Hth,

[1] http://download.qualitystreetmap.org/vm-georchestra/setup.txt

--
Pierre

Jesse Eichar

unread,
Dec 5, 2012, 2:24:07 AM12/5/12
to georc...@googlegroups.com
As Pierre said.  One of the reasons that we have Geoserver in another tomcat is because the apache rules for making geoserver work with the context name geoserver-private is rather complicated.  

There are actually 3 reasons we have Geoserver in a different tomcat:
  1. The geoserver-private context is difficult to make work
  2. It makes starting the tomcats faster because geonetwork and geoserver both take a long time to start.  Having them in different servers makes starting either of the tomcat instances faster.
  3. when geoserver is ran with certain versions of Geonetwork the Geonetwork saxon xsl transformer can interfer with geoserver and cause it to crash and vice-versa.  This is the reason we also want to move the geowebcache into geoserver's tomcat.
Jesse



--
--
Vous avez reçu ce message, car vous êtes abonné au groupe
Groupe "georchestra" georc...@googlegroups.com
voir http://groups.google.fr/group/georchestra

Site web : http://www.georchestra.org




Message has been deleted

Florent Gravin

unread,
Dec 10, 2012, 6:03:26 AM12/10/12
to georc...@googlegroups.com
Hi,

rewrite ^/geoserver-private/(.*)$ /geoserver/$1 permanent;

Adding a new RewriteRule uppon the first one (RewriteRule ^/geoserver$ /geoserver/ [R]) is quite dangerous cause each request to geoserver will pass twice through the RewriteRules and will be encoded twice before it gets to geoserver. The problem will be then that geoserver won't be able to decode properly the url and will send an error like 

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://vm-georchestra:80/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" > <ServiceException code="LayerNotDefined" locator="MapLayerInfoKvpParser">

georchestra%3Aroutes-languedocroussillon: no such layer on this server

</ServiceException></ServiceExceptionReport>


You can add the marker [R=302,NE] to the second RewriteRule (in apache) to avoid double encoding of the url.

Anyway, as Jesse said, it is not recommanded to have geoserver on the same tomcat.
Reply all
Reply to author
Forward
0 new messages