Closed Ailurupoda closed 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/.
Great, i'll check on that. Thank you :)
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 ?
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 ?
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.
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.
Hi David, Just to understand as a noob
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
Ok we will try to understand how it could works with our architecture. Thanks
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