Add simple configuration block to the default NGINX server to add additional proxy for /cors to /geoserver that adds
Access-Control-Allow-Origin: *`
but doesn't interfere with direct /geoserver calls. Needed for cross-orgin GeoJSON WFS requests.
For example, from:
http://example.com/geoserver/wfs?srsName=EPSG%3A4326&typename=geonode%3Aexamplelayer&outputFormat=json&version=1.0.0&service=WFS&request=GetFeature
to
http://example.com/cors/geoserver/wfs?srsName=EPSG%3A4326&typename=geonode%3Aexamplelayer&outputFormat=json&version=1.0.0&service=WFS&request=GetFeature
Implementation from http://enable-cors.org/server_nginx.html or something like that. Maybe just HTTP GET.
Add simple configuration block to the default NGINX server to add additional proxy for
/corsto/geoserverthat addsbut doesn't interfere with direct
/geoservercalls. Needed for cross-orgin GeoJSON WFS requests.For example, from:
to
Implementation from http://enable-cors.org/server_nginx.html or something like that. Maybe just HTTP GET.