qgis / qgis-docker

Official Docker image for QGIS Server and Desktop
GNU Affero General Public License v3.0
75 stars 24 forks source link

Strange long URL suffix starting with `?map=...` while browsing the WFS3 web pages of the project #75

Open swiss-knight opened 2 years ago

swiss-knight commented 2 years ago

Hello,

I had to rewrite the line 88 of nginx-fcgi-sample.conf

from this:

rewrite ^/ogc/(.*)$ /qgis/qgis_mapserv.fcgi?map=/io/data/$1/$1.qgs;

to this:

rewrite ^/ogc/(.*)$ /qgis/qgis_mapserv.fcgi;

In order to be able to see correctly formatted hyperlinks when browser QGIS server web pages.

E.g. at: http://127.0.0.1:8010/ogc/myproject-folder/wfs3/collections/{collectionId}/items/ clicking a feature will open it at this URL (which is the expected behaviour):
http://127.0.0.1:8010/ogc/myproject-folder/wfs3/collections/{collectionId}/items/{itemId}.html

Because with the current version of the nginx config file, it opens as follows: http://127.0.0.1:8010/ogc/myproject-folder/wfs3/collections/{collectionId}/items/{itemId}?map=/io/data/myproject-folder/wfs3/collections/{collectionId}/items//myproject-folder/wfs3/collections/{collectionId}/items/.qgs

image

The feature is correctly displayed in the browser, that's not the problem, but the URL is quite messy as you can see, and each and every hyperlink on the QGIS server pages, is suffering a similar very long ?map=... suffix.

I'm wondering if I missed something in the configuration?

Please note that my QGIS project file is located, within the container, in this folder:

root@qgisserver:~# ls -lh /io/data/myproject-folder/
total 21M
-rw-rw-r-- 1 1000 1000 21M Feb  5 08:32 myproject-file.qgs

and that I had to add this env var to the Compose file:

QGIS_PROJECT_FILE: "/io/data/myproject-folder/myproject-file.qgs"

Without the QGIS_PROJECT_FILE var, I'm facing an empty Collections page with this error:

qgisserver_1  | 11:27:06 CRITICAL Server[14]: Error when loading project file '/io/data/myproject-folder/wfs3/collections/myproject-folder/wfs3/collections.qgs': Unable to open /io/data/myproject-folder/wfs3/collections/myproject-folder/wfs3/collections.qgs 
qgisserver_1  | 11:27:06 CRITICAL Server[14]: Error when loading project file '/io/data/myproject-folder/wfs3/static/style.css/myproject-folder/wfs3/static/style.css.qgs': Unable to open /io/data/myproject-folder/wfs3/static/style.css/myproject-folder/wfs3/static/style.css.qgs 
qgisserver_1  | 11:27:06 CRITICAL Server[14]: Error when loading project file '/io/data/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.css/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.css.qgs': Unable to open /io/data/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.css/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.css.qgs 
qgisserver_1  | 11:27:06 CRITICAL Server[14]: Error when loading project file '/io/data/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.js/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.js.qgs': Unable to open /io/data/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.js/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.js.qgs 
mbernasocchi commented 2 years ago

@daniviga what do you think?