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
A few code changes in MythWeb will change the URLs to protocol relative URLs. This makes it much easier to put MythWeb behind a reverse proxy (like nginx) and add the security of SSL certificates.
In a rendered page of MythWeb, the output includes links written like this
MythTV version 34 has a new web app that has all of the function of mythweb at http://backend:6544. You can try that now on the master version of mythbackend and let me know if any change is needed to support the reverse proxy.
A few code changes in MythWeb will change the URLs to protocol relative URLs. This makes it much easier to put MythWeb behind a reverse proxy (like nginx) and add the security of SSL certificates.
In a rendered page of MythWeb, the output includes links written like this
<link rel="stylesheet" type="text/css" href="http://my_myth_tv_server/mythweb/skins/default/style.css">
This breaks behind a nginx reverse proxy (which I use to give myself secure access using SSL), so my MythWeb page looks like this:
https://imgur.com/a/lQqR4Cp
They should have the http: removed, so they look like this in the HTML:
<link rel="stylesheet" type="text/css" href="//my_myth_tv_server/mythweb/skins/default/style.css">
That is there should be no http:// in the URL, it should just be //
This would mean that the generated HTML will render correctly regardless of whether the MythWeb is hosted on a http or https webserver.
All that needs to be changed is this line in /usr/share/mythtv/mythweb/includes/defines.php
$root_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
Becomes
$root_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? '//' : '//';
Obviously there's a more elegant way of doing this, but I'm not a php expert. I figured this out with a bit of trial and error.
My version of MythTV
/mythbuntu/33/ubuntu jammy/main amd64 mythweb all 2:33.1+fixes.202401131706.512d723c83~ubuntu22.04.1
It is a simple fix, it won't break MythWeb for anyone, but it will help me not having to go in and edit defines.php everytime MythWeb is updated 😉
The text was updated successfully, but these errors were encountered: