3liz / docker-qgis-server

Build docker qgis tornado server image
6 stars 1 forks source link

Add CORS on server #9

Closed Ailurupoda closed 5 years ago

Ailurupoda commented 5 years ago

Hi, Working with webmap server and using flux server from different origin appears to be difficult. In fact the CORS parameter might be needed to call flux from different web platform.

Do you think it could be possible to add that CORS parameter on the qgis-server ? Or do you know how i could activate it after it's deployed ?

Tahnks a lot

dmarteau commented 5 years ago

CORS is enabled by default and set allow from all origins: see https://github.com/3liz/py-qgis-server/blob/master/pyqgisserver/handlers/basehandler.py#L69.

By default CORS is set to allow from all origins so you should not have any problems, please remember that client must set the 'Origin' header in order to get a Access-Control-Allow-Origin response.

There is plan to allow origin restriction on https://github.com/3liz/py-qgis-server/.

Ailurupoda commented 5 years ago

Great, i'll check on that. Thank you :)

Ailurupoda commented 4 years ago

How do i use that py-qgis-server with a docker qgis-map-server ? Is it installed by default, do i need to add something or is it 2 different stuff ?

Ailurupoda commented 4 years ago

Hi, Sorry to re-open this issue, I've been working with the Docker Qgis Server from Kartoza (https://hub.docker.com/r/kartoza/qgis-server/dockerfile) so far. And it works well with the cross-origin.

Do you have an idea why with yours, using the docker qgis-map-server (https://hub.docker.com/r/3liz/qgis-map-server/) this doesn't work ?

dmarteau commented 4 years ago

Sorry, but I can't, can you provide some more context about the problem you have ?

Here is the implementation of CORS support: https://github.com/3liz/py-qgis-server/blob/master/pyqgisserver/handlers/basehandler.py#L71. If you think there is a mistake, please be kind to report it.

dmarteau commented 4 years ago

I've been working with the Docker Qgis Server from Kartoza (https://hub.docker.com/r/kartoza/qgis-server/dockerfile) so far

This image is using a Apache server in front of the fcgi module, you may check the Apache configuration.

Doctor-Who commented 4 years ago

Hi David, Just to understand as a noob

dmarteau commented 4 years ago

3Liz Docker is only about QGIS Server and not with any webserver

Not exactly: it uses https://github.com/3liz/py-qgis-server as a web server wrapper for qgis server as python api: https://qgis.org/pyqgis/master/server/QgsServer.html

Doctor-Who commented 4 years ago

Ok we will try to understand how it could works with our architecture. Thanks