Feature request #16096

QGIS Server proxy settings

Added by Giovanni Allegri almost 8 years ago. Updated almost 6 years ago.

Status:Open
Priority:High
Assignee:-
Category:QGIS Server
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:24010

Description

There's a related old issue #12840 about this but I open a new one because it's about QGIS2.ini not being read by QGIS Server, while I would ask it in more general terms: looking inside the QGIS Server code it seems that it doesn't take into account any proxy setting. Is it right? It's not a bug certainly but an important missing feature for sure.
Can anybody confirm this?


Related issues

Related to QGIS Application - Bug report #12840: qgis_mapserv.fcgi not using proxy settings in QGIS2.ini Closed 2015-05-28

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No

#2 Updated by Jürgen Fischer almost 6 years ago

  • Related to Bug report #12840: qgis_mapserv.fcgi not using proxy settings in QGIS2.ini added

#3 Updated by Holger Bruch almost 6 years ago

Using release 3.4.2, I made some progress, though not 100% yet.

Configuring "FcgidInitialEnv QGIS_OPTIONS_PATH /qgis/options/path/" and providing /qgis/options/path/QGIS/QGIS3.ini file with a section like e.g.:

[proxy]
proxyEnabled=true
proxyType=HttpProxy
proxyHost=myproxyhost
proxyPort=8080

will enable the proxy.

However, I'm still not successful with the following setup:
QGIS/QGIS3.ini:
[proxy]
proxyEnabled=true
proxyType=DefaultProxy

/etc/apache2/conf-enabled/qgis.conf:
...
FcgidInitialEnv QGIS_OPTIONS_PATH /qgis/options/path/
FcgidInitialEnv http_proxy http://myproxy:80/
...

With log level QGIS_DEBUG set to 5, the debug log reports:
src/core/qgsnetworkaccessmanager.cpp: 339: (setupDefaultProxyAndCache) [8ms] setting default proxy
src/core/qgsnetworkaccessmanager.cpp: 163: (setFallbackProxyAndExcludes) [0ms] proxy settings: (type:HttpProxy host: myproxy:80, user:, password:not set
src/core/qgsnetworkaccessmanager.cpp: 390: (setupDefaultProxyAndCache) [1ms] cacheDirectory: /var/www/.local/share/QGIS/QGIS3/profiles/default/cache/
src/core/qgsnetworkaccessmanager.cpp: 391: (setupDefaultProxyAndCache) [0ms] maximumCacheSize: 52428800
src/core/qgsnetworkaccessmanager.cpp: 223: (createRequest) [1ms] Created [reply:3d89270]
src/core/qgsnetworkaccessmanager.cpp: 86: (queryProxy) [0ms] requesting system proxy for query http://amapservice/?SERVICE=WMS&REQUEST=GetCapabilities
src/core/qgsnetworkaccessmanager.cpp: 91: (queryProxy) [0ms] using system proxy :0 for query

So QNetworkProxyFactory::systemProxyForQuery() finds the proxy defined via the http_proxy env variable (mind the lowercase!), but QNetworkProxyFactory::systemProxyForQuery( query ) apparently does not(?)

Also available in: Atom PDF