You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform: Raspberry Pi 3 using docker as server (f9d9ff1a354d), Chrome on Windows 10 as client
Node Version: 12, the version in the latest(f9d9ff1a354d) docker image
MagicMirror Version: v2.10.1
Description: I want to use Magic Mirror behind a Reverse proxy so I can access it via a sub path in the url as http://localhost/magic-mirror/. I setup a Preserve Proxy so I can access http://localhost/magic-mirror/, but it only shows a blackscreen. The console log of the browser shows that the socket.io.js could not be loaded. That's because it's loaded from an absolute path in index.html (src="/socket.io/socket.io.js"). All other scripts are loaded without problem, because they are using relative paths.
I removed the / from the path in the index.html but socket.io also uses absolute path somewhere else. So this simple change did not solve the whole problem.
Steps to Reproduce:
Start the MagicMirror docker container
setup Reverse Proxy using e.g. apache2:
ProxyPass "/magic-mirror/" "http://localhost:8080/"
ProxyPassReverse "/magic-mirror/" "http://localhost:8080/"
ProxyPreserveHost On
open http://localhost/magic-mirror/
Expected Results: open http://localhost/magic-mirror/ should show magic mirror
Actual Results: Blackscreen, chrome console log:
GET http://localhost/socket.io/socket.io.js net::ERR_ABORTED 404 (Not Found)
main.js:455 Initializing MagicMirror.
...
the url should be http://localhost/magic-mirror/socket.io/socket.io.js
Configuration: default docker config
Additional Notes: I want to use Magic Mirror behind a Reverse Proxy, because then I can better manage all exposed services and protect them with password and TLS. The localhost urls are only used for simplification.
The text was updated successfully, but these errors were encountered:
I found a fix for the problem and can provide a PR. But we have to discuss the solution as there could be conflicts with the url handling and other modules.
Platform: Raspberry Pi 3 using docker as server (f9d9ff1a354d), Chrome on Windows 10 as client
Node Version: 12, the version in the latest(f9d9ff1a354d) docker image
MagicMirror Version: v2.10.1
Description: I want to use Magic Mirror behind a Reverse proxy so I can access it via a sub path in the url as
http://localhost/magic-mirror/
. I setup a Preserve Proxy so I can accesshttp://localhost/magic-mirror/
, but it only shows a blackscreen. The console log of the browser shows that thesocket.io.js
could not be loaded. That's because it's loaded from an absolute path in index.html (src="/socket.io/socket.io.js"
). All other scripts are loaded without problem, because they are using relative paths.I removed the
/
from the path in theindex.html
but socket.io also uses absolute path somewhere else. So this simple change did not solve the whole problem.Steps to Reproduce:
http://localhost/magic-mirror/
Expected Results: open
http://localhost/magic-mirror/
should show magic mirrorActual Results: Blackscreen, chrome console log:
the url should be
http://localhost/magic-mirror/socket.io/socket.io.js
Configuration: default docker config
Additional Notes: I want to use Magic Mirror behind a Reverse Proxy, because then I can better manage all exposed services and protect them with password and TLS. The
localhost
urls are only used for simplification.The text was updated successfully, but these errors were encountered: