# @path: /etc/nginx/snippets/qgis-server.conf # @permission: -rw-r--r-- 1 root root # Multi-Proces qgis upstream qgis-server_backend { {% for item in range(1, qgis_server['count'] + 1, 1) %} server unix:/run/qgis-server-{{ item }}.sock; {% endfor %} } server { listen {{ qgis_server['port'] }} default_server; listen [::]:{{ qgis_server['port'] }} default_server; root /var/www/html; index index.php index.html index.htm index.nginx-debian.html; server_name qgis-server; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } # pass PHP scripts to FastCGI server location ~ \.php$ { include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): fastcgi_pass unix:/run/php/php{{ php['version'] }}-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } # Single-Proces qgis #location /qgis-server { # gzip off; # include fastcgi_params; # fastcgi_pass unix:/run/qgisserver.socket; #} # Multi-Process qgis location /qgis-server { gzip off; include fastcgi_params; # for xvfb # fastcgi_param DISPLAY ":99"; fastcgi_pass qgis-server_backend; } }