apache2 reverse proxy setup
-
Hello,
I'm trying to make access to mango via Apache reverse proxy installed on the same machine, and after that I will try to use Let's Encrypt certificate.
Now my apache .conf looks like:
<VirtualHost *:80> RewriteEngine On RewriteCond %{HTTP:Connection} Upgrade [NC] RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteRule /(.*) ws://127.0.0.1:8080/$1 [P,L] ProxyRequests off <Location /> ProxyPass http://127.0.0.1:8080/ ProxyPassReverse / </Location> </VirtualHost>
Actually with this setup I can open Mango webpage, can see datapoints, but some my points are pictures (datasource: HTTP Images) which aren't loaded.
Failed to load resource: net::ERR_CONNECTION_REFUSED http://127.0.0.1:8080/imageValue/1516192015304_110.jpg
As you see they still have localhost address..
Can you help me with this setup?
-
Hi dovydas,
Unfortunately those image src values are being set directly from the code for the host in the request. This is probably not the ideal behavior - it should only supply a path on the host, not include the host in the path. This is a change in the API module, and while in theory someone could have relied on their request host being in the image URL, we decided it was more likely someone would be doing what you are and that we should supply paths without the request host, port or scheme inserted. This is the git issue for this: https://github.com/infiniteautomation/ma-core-public/issues/1202
It will probably be done fairly soon.
-
You should be able to update to version 3.3.1 of the MangoAPI module now. This should supply img source paths that do not contain host, scheme, or port information, which should resolve the issue you were seeing. Thanks for bringing this to our attention!
-
Thank you! It's working now :)