[qgis-qwc2] Proxy (again) causes ERROR reading WMS GetProjectSettings

Thomas Schüttenberg thomas at qgis.de
Thu Sep 3 06:17:10 PDT 2020


Hi there!

For one and a half year I have a still running QWC2, displaying some of my own QGIS Server WMS projects as a demo. I never touched it since then but now it is time to run themesconfig again with new and nicer projects.

Unfortunately I got into trouble (again) with our corporate proxy environment. 
The proxy here is configurated by .pac files (proxy auto-configation) [0] from which I extracted the proxy host-ip and port. Git, node and yarn have been configured successfully with the proxy settings and work. 
If generating a themes.json from the themesConfig.json out of the demo-app package - adding a toplevel block to specify the proxy settings to use in themesConfig.json as stated in the docs [1] - it works. All WMS in this themesConfig.json are outside of my network, so the proxy is needed and used.

If I adapt this themesConfig.json with my own QGIS server WMS, which are within my local network, then it fails, 
accessing my service is forbidden. From the bash:

ERROR reading WMS GetProjectSettings of http://nt440geo3:90/ows/altgrundkarte:
Error: Request failed with status code 403
      at createError (C:\QWC2_dev\qwc2-demo-app\node_modules\axios\lib\core\create
Error.js:16:15)
      at settle (C:\QWC2_dev\qwc2-demo-app\node_modules\axios\lib\core\settle.js:1
7:12)
      at IncomingMessage.handleStreamEnd (C:\QWC2_dev\qwc2-demo-app\node_modules\a
xios\lib\adapters\http.js:237:11)
      at IncomingMessage.emit (events.js:327:22)
      at endReadableNT (_stream_readable.js:1220:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21) {
   config: {
      url: 'http://nt440geo3:90/ows/altgrundkarte?SERVICE=WMS&VERSION=1.3.0&REQUES
T=GetProjectSettings',
      method: 'get',
      headers: {
         Accept: 'application/json, text/plain, */*',
         'User-Agent': 'axios/0.19.0',
         host: 'nt440geo3:90'
      },
      proxy: { host: '10.0.200.200', port: '8080' },

Ok, there is an exeption for the subnet of my server in the pac-file, so the proxy is not meant to be used and a failing request seems correct(?).

But if I remove the proxy in themesConfig.json it doesn't work either, then the connection is refused:
ERROR reading WMS GetProjectSettings of http://nt440geo3:90/ows/altgrundkarte:
Error: connect ECONNREFUSED 127.0.0.1:80
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
   errno: 'ECONNREFUSED',
   code: 'ECONNREFUSED',
   syscall: 'connect',
   address: '127.0.0.1',
   port: 80,
   config: {
      url: 'http://nt440geo3:90/ows/altgrundkarte?SERVICE=WMS&VERSION=1.3.0&REQUES
T=GetProjectSettings',
      method: 'get',
      headers: {
         Accept: 'application/json, text/plain, */*',
         'User-Agent': 'axios/0.19.0',
         host: 'nt440geo3:90'
      },
      proxy: { host: '', port: '' },

because it tries to connect to 127.0.0.1. - But why? How to configure an equivalent of the 'return "DIRECT"' in the pac-file?

Although this is not an issue of QWC itself, could somone give me a clue on how to configure this beast so that it will generate themes.json again?

Thanks in advance, all the best
Thomas

[0] https://docs.microsoft.com/de-de/internet-explorer/ie11-ieak/proxy-auto-config-examples#beispiel-4-direktes-verbinden-wenn-sich-der-host-in-einem-angegebenen-subnetz-befindetexample-4-connect-directly-if-the-host-is-in-specified-subnet
[1] https://github.com/qgis/qwc2-demo-app/blob/master/doc/QWC2_Documentation.md#themes-json

-- 
QGIS-DE e.V. | https://qgis.de | thomas at qgis.de


More information about the qgis-qwc2 mailing list