3

I have developed an OpenLayers web app that uses GeoServer. I am using nginx as my webserver with proxy_pass setup for GeoServer. Everything works as expected when I use "localhost" but when I switch to my IP address I get a 504 Gateway Time-Out error for

http://98.153.141.207/geoserver/cite/wfs.  

I can access GeoServer at

http://98.153.141.207/geoserver/web

via a browser without problem so it would appear the proxy continues to work as expected.

The GeoServer log shows this when the problem occurs:

Request: describeFeatureType
    service = WFS
    version = 1.1.0
    baseUrl = http://98.153.141.207:80/geoserver/
    typeName[0] = {http://www.opengeospatial.net/cite}MyLayer
    outputFormat = text/xml; subtype=gml/3.1.1

Then after a minute, I get the 504 Gateway Time-Out in my JavaScript console and this shows up in the GeoServer log:

09 May 06:02:15 WARN [geotools.xml] - Error parsing: http://98.153.141.207/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=cite:MyLayer

I have tried this supposed problem URL in a browser and it works fine.

The nginx erorr log contains this:

2013/05/09 06:02:15 [error] 420#3844: *54 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 98.153.141.207, server: localhost, request: "GET /geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=cite:MyLayer HTTP/1.1", upstream: "http://127.0.0.1:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=cite:MyLayer", host: "98.153.141.207"

Further investigation reveals that this problem seems to be restrict to WFS layers only. The WMS layers work fine. Here is the declaration of my WFS layer that fails:

myLayer = new OpenLayers.Layer.Vector("MyLayer",
                                    {
                                      strategies: [new OpenLayers.Strategy.BBOX(),saveStrategy],
                                      projection: "EPSG:2276",
                                      protocol: new OpenLayers.Protocol.WFS(
                                      {
                                        version: "1.1.0",
                                        url: "http://" + hostip + "/geoserver/cite/wfs",
                                        featureNS: "http://www.opengeospatial.net/cite",
                                        srsName: "EPSG:2276",
                                        featureType: "MyLayer",
                                        geometryName: "Poly",
                                        schema: "http://" + hostip + "/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=cite:MyLayer"
                                      })
                                    });

Any help would be appreciated. Thanks

I managed to get this working by remove the "schema" property from the OpenLayer.Protocol.WFS of my layer. Can anyone explain why this would be the problem?

Hilo
  • 869
  • 2
  • 9
  • 24

0 Answers0