qgis / qgis-docker

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

Improve NGINX conf and README #6

Closed daniviga closed 5 years ago

daniviga commented 5 years ago

Preparing for the 3.4 release I've update a bit the nginx configuration to be more clean and flexible.

Since server_name, which is used to populate SERVER_NAME in FastCGI, cannot be know a priori we use the Host header to set it. Same is done for Scheme. Port is taken splitting $http_host These variables are used by QGIS server to build GetCapabilities URLs. If a reverse proxy sets X-Forwarded-* those are used instead.

It can be tested via tag 3.4. (see https://github.com/gem/oq-qgis-server/blob/master/.travis.yml for an example). You should get

<OnlineResource xlink:type="simple" xlink:href="http://localhost:8010?map=/io/data/test_project/test_project.qgs&service=WMS&request=GetCapabilities"/>

instead of

<OnlineResource xlink:type="simple" xlink:href="http:?map=/io/data/test_project/test_project.qgs&service=WMS&request=GetCapabilities"/>