[GIS] QGIS Redirecting WMS Request to localhost

qgiswms

Whenever I add a WMS layer, from a server on the local intranet, the WMS request gets sent to localhost instead of the actual server I am referencing.

I am enclosing screenshots to make sure my problem is clear.

Here's how I add a new WMS connection:
enter image description here

When I hit connect, the layers from the server are actually listed as shown below, showing that atleast the GetCapabilities request is going through fine:
enter image description here

However, the map doesn't show up and I get a 'Connection Refused' label under the map layer:
enter image description here

When I look in the logs, I see that the error message references 'localhost' instead of the server I set:
enter image description here

Clearly, something seems off. If I just copy the request from the log window and replace the localhost with my server IP into Firefox, then the request goes through fine and I see the map in Firefox.

Stranger still, is that if I look at the layer information, the server URL is referenced correctly:
enter image description here

This seems to be happening only in Windows QGIS builds. On Linux, the map shows up as expected.

Here is the QGIS version information:
enter image description here

I am posting here to check if I am doing something wrong. I can't seem to find a QGIS bug that describes this issue so I want to rule out that I am getting something wrong.

Best Answer

The issue here appears to be that the WMS GetCapabilities response has http://localhost... hard coded into it, whereas it should have http://192.168.1.38...

QGIS provides the option to ignore the reported GetMap and GetFeatureInfo service end points, (by ticking the check boxes), and instead use the URL you supplied to obtain the GetCapabilities response.