[Geoserver-users] MapPreview: openlayers examples no longer working in 1.7.2 from behind proxy

Hi all,

I have switched from 1.6.2 to 1.7.2. My geoserver is running behind a proxy, result is that the openlayers demo's are no longer working when you access them from outside ( www ) ...
Here's what I did:

1 ) Adjust jetty ( to have the correct context path )

in "/geoserver-1.7.2/webapps/geoserver/WEB-INF/jetty-web.xml" I added the following line:
...
  <Set name="contextPath">/myproject/geoserver</Set>
...

This makes jetty listen to http://192.168.2.37:8080/myproject/geoserver

2) Adjust geoserver configuration ( to have the correct base url in the code that is send back to the browser )

/geoserver-1.7.2/data_dir/services.xml: <ProxyBaseUrl>http://myserver.mycompany.be/dmt/geoserver/&lt;/ProxyBaseUrl&gt;

So my external address is at "myserver.mycompany.be"

3) go to "http://myserver.mycompany.be/myproject/geoserver/mapPreview.do&quot;

There choose a Openlayers example, the result is html code that has WMS declarations like this

............
// setup tiled layer
                tiled = new OpenLayers.Layer.WMS(
                    "DMT:dmt_whole - Tiled", "http://192.168.2.37:8080/myproject/geoserver/wms&quot;,
                    {
                        height: '379',
                        width: '800',
                        layers: 'DMT:dmt_whole',
                        styles: '',
                        srs: 'EPSG:32631',
                        format: format,
                        tiled: 'true',
                        tilesOrigin : "436000,5648999"
                    },
                    {buffer: 0}
                );

.................

So this does not work from outside the firewall .... the browser is trying to connect to the internal address http://192.168.2.37:8080, so the examples are no longer working in 1.7.2, but it used to be in 1.6.2

Regards,
Stephen

---
This e-mail, any attachments and the information it contains are confidential and meant only for the use of the addressee(s) only. Access to this e-mail by anyone other than the addressee(s) is unauthorized. If you are not the intended addressee (or responsible for delivery of the message to such person), you may not use, copy, distribute or deliver to anyone this message (or any part of its contents) or take any action in reliance on it. In such case, you should destroy this message and notify the sender immediately. If you have received this e-mail in error, please notify us immediately by e-mail or telephone and delete the e-mail from any computer.
All reasonable precautions have been taken to ensure no viruses are present in this e-mail and its attachments. As our company cannot accept responsibility for any loss or damage arising from the use of this e-mail or attachments we recommend that you subject these to your virus checking procedures prior to use.

I have the same problem.
My GeoServer work's behind a proxy and I configured in the GeoServer config
the Proxy Base-URL to a non localhost ip with port 8081.

If I get some demo examples with openlayers than the requested host was
localhost:8081.

<!-- Import OpenLayers, reduced, wms read only version -->
<script src="http://localhost:8081/geoserver/openlayers/OpenLayers.js&quot;
type="text/javascript">

I think there is maybe a bug, which loses or misses the server proxy
base-url configuration from the services.xml.

I run the GeoServer 1.7.2 Version and there should be the bug. My older
GeoServer 1.6.3 Version work fine with these configurations and demo
openlayers sides.

Greetings 2StepForward
--
View this message in context: http://www.nabble.com/MapPreview%3A-openlayers-examples-no-longer-working-in-1.7.2-from-behind-proxy-tp22003862p22288685.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Has anyone a idea, how I can solve this issue with the Proxy Base-URL
configuration, or is there any patch for the GeoServer 1.7.2 version?

Thanks, 2StepForward

2StepForward wrote:

I have the same problem.
My GeoServer work's behind a proxy and I configured in the GeoServer
config the Proxy Base-URL to a non localhost ip with port 8081.

If I get some demo examples with openlayers than the requested host was
localhost:8081.

<!-- Import OpenLayers, reduced, wms read only version -->
<script src="http://localhost:8081/geoserver/openlayers/OpenLayers.js&quot;
type="text/javascript">

I think there is maybe a bug, which loses or misses the server proxy
base-url configuration from the services.xml.

I run the GeoServer 1.7.2 Version and there should be the bug. My older
GeoServer 1.6.3 Version work fine with these configurations and demo
openlayers sides.

Greetings 2StepForward

--
View this message in context: http://www.nabble.com/MapPreview%3A-openlayers-examples-no-longer-working-in-1.7.2-from-behind-proxy-tp22003862p22308122.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Has anyone a idea, how I can solve this issue with the Proxy Base-URL
configuration, or is there any patch for the GeoServer 1.7.2 version?

Thanks, 2StepForward

2StepForward wrote:

I have the same problem.
My GeoServer work's behind a proxy and I configured in the GeoServer
config the Proxy Base-URL to a non localhost ip with port 8081.

If I get some demo examples with openlayers than the requested host was
localhost:8081.

<!-- Import OpenLayers, reduced, wms read only version -->
<script src="http://localhost:8081/geoserver/openlayers/OpenLayers.js&quot;
type="text/javascript">

I think there is maybe a bug, which loses or misses the server proxy
base-url configuration from the services.xml.

I run the GeoServer 1.7.2 Version and there should be the bug. My older
GeoServer 1.6.3 Version work fine with these configurations and demo
openlayers sides.

Greetings 2StepForward

--
View this message in context: http://www.nabble.com/MapPreview%3A-openlayers-examples-no-longer-working-in-1.7.2-from-behind-proxy-tp22003862p22308127.html
Sent from the GeoServer - User mailing list archive at Nabble.com.