0

I have Nginx running as a proxy for a number of services including a Geoserver running on port 8080 with the following config:

   location ^~ /wms/ {
           rewrite  ^/wms/(.*)$  /geoserver/ows$1  break;
           proxy_pass http://127.0.0.1:8080;
           proxy_connect_timeout 60s;
           proxy_read_timeout 150s;
       }

and a proxy service to avoid SOP problems which works as follows:

  location ^~ /proxy/?targetURL= {
           rewrite  ^/proxy/?targetURL=(.*)$ $1  break;
           proxy_pass $1;
           proxy_connect_timeout 60s;
           proxy_read_timeout 150s;
       }

My web server is also under the same domain, ran by a jetty on port 8888, handled by the same proxy.

   location / {
           proxy_pass http://127.0.0.1:8888;
           proxy_connect_timeout 60s;
           proxy_read_timeout 150s;
       }

From my web application I make WMS server calls for data via my proxy service. It works fine for external servers but it hangs when I call my own internal geoserver. My geoserver proxy works fine, I can make WMS service queries with the said URL.

The call that hangs is basically:

http://mywebappdomain.com/proxy/?targetURL=http://mywebappdomain.com/wms/?my_set_of_parameters

Which means that the proxy rule applies and the WMS service is called from the same server.

Is there an issue with proxying over itself?

3
  • I would find some other way of doing whatever it is you're doing. You've opened up a huge security hole in your server, as now anybody can proxy anything from any website and you will take the blame. Nov 9, 2013 at 23:35
  • Yes, pretty scary. My plan is to use a white list of allowed hosts. The idea is from trac.osgeo.org/openlayers/wiki/…. Any suggestions towards a (better) way of doing is very welcome obviously ;-)
    – Thomas
    Nov 10, 2013 at 18:23
  • location /proxy/?targetURL= dosn't work since the location directive doesn't match request arguments.
    – VBart
    Nov 11, 2013 at 17:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.