.*)" $p;
63 | default $server_port;
64 | }
65 | # Get 'HTTPS' status from `$https` unless 'X-Forwarded-Proto'
66 | # is set by the reverse proxy and contains 'https' scheme
67 | map $http_x_forwarded_proto $qgis_ssl {
68 | "https" "on";
69 | default $https;
70 | }
71 | # Get 'PORT' from `$port` unless 'X-Forwarded-Port'
72 | # is set by the reverse proxy
73 | map $http_x_forwarded_port $qgis_port {
74 | "" $port;
75 | default $http_x_forwarded_port;
76 | }
77 |
78 | server {
79 | listen 80 default_server;
80 | listen [::]:80 default_server;
81 | server_name _;
82 | root /usr/share/nginx/html;
83 |
84 | location / {
85 | root /var/www/html;
86 | }
87 | location /ogc/ {
88 | rewrite ^/ogc/(.*)$ /qgis/qgis_mapserv.fcgi?map=/io/data/$1/$1.qgs;
89 | }
90 | location /qgis/ {
91 | internal; # Used only by the OGC rewrite
92 | root /var/www/data;
93 | fastcgi_pass qgis-fcgi;
94 |
95 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
96 | fastcgi_param QUERY_STRING $query_string;
97 | # build links in GetCapabilities based on
98 | # the hostname exposed by the reverse proxy
99 | fastcgi_param HTTPS $qgis_ssl;
100 | fastcgi_param SERVER_NAME $qgis_host;
101 | fastcgi_param SERVER_PORT $qgis_port;
102 | include fastcgi_params;
103 | }
104 | error_page 404 /404.html;
105 | location = /40x.html {
106 | }
107 | error_page 500 502 503 504 /50x.html;
108 | location = /50x.html {
109 | }
110 | }
111 |
112 | }
113 |
--------------------------------------------------------------------------------
/server/conf/pg_service.conf:
--------------------------------------------------------------------------------
1 | [demoservice]
2 | host=localhost
3 | dbname=gis
4 | port=5432
5 | user=docker
6 | password=docker
7 |
--------------------------------------------------------------------------------
/server/conf/qgis-server-nginx.conf:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
3 | #
4 | # oq-qgis-server
5 | # Copyright (C) 2018-2019 GEM Foundation
6 | #
7 | # oq-qgis-server is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as published by
9 | # the Free Software Foundation, either version 3 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # oq-qgis-server is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .*)" $p;
55 | default $server_port;
56 | }
57 | # Get 'HTTPS' status from `$https` unless 'X-Forwarded-Proto'
58 | # is set by the reverse proxy and contains 'https' scheme
59 | map $http_x_forwarded_proto $qgis_ssl {
60 | "https" "on";
61 | default $https;
62 | }
63 | # Get 'PORT' from `$port` unless 'X-Forwarded-Port'
64 | # is set by the reverse proxy
65 | map $http_x_forwarded_port $qgis_port {
66 | "" $port;
67 | default $http_x_forwarded_port;
68 | }
69 |
70 | server {
71 | listen 80 default_server;
72 | listen [::]:80 default_server;
73 | server_name _;
74 | root /usr/share/nginx/html;
75 |
76 | location /ogc/ {
77 | rewrite ^/ogc/(.*)$ /qgis/qgis_mapserv.fcgi?map=/io/data/$1/$1.qgs;
78 | }
79 | # Direct access without map rewrite
80 | location /ows/ {
81 | rewrite ^/ows/$ /qgis/qgis_mapserv.fcgi;
82 | }
83 | location /wfs3/ {
84 | rewrite ^/wfs3/(.*)$ /qgis/qgis_mapserv.fcgi;
85 | }
86 | location /qgis/ {
87 | internal; # Used only by the OGC rewrite
88 | root /var/www/data;
89 | fastcgi_pass localhost:9993;
90 |
91 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
92 | fastcgi_param QUERY_STRING $query_string;
93 | # build links in GetCapabilities based on
94 | # the hostname exposed by the reverse proxy
95 | fastcgi_param HTTPS $qgis_ssl;
96 | fastcgi_param SERVER_NAME $qgis_host;
97 | fastcgi_param SERVER_PORT $qgis_port;
98 | include fastcgi_params;
99 | }
100 | error_page 404 /404.html;
101 | location = /40x.html {
102 | }
103 | error_page 500 502 503 504 /50x.html;
104 | location = /50x.html {
105 | }
106 | }
107 |
108 | }
109 |
--------------------------------------------------------------------------------
/server/start-xvfb-nginx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # -*- coding: utf-8 -*-
3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
4 | #
5 | # oq-qgis-server
6 | # Copyright (C) 2018-2019 GEM Foundation
7 | #
8 | # oq-qgis-server is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU Affero General Public License as published by
10 | # the Free Software Foundation, either version 3 of the License, or
11 | # (at your option) any later version.
12 | #
13 | # oq-qgis-server is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU Affero General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Affero General Public License
19 | # along with this program. If not, see