SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux > SageTV for unRAID/Docker

Notices

SageTV for unRAID/Docker Discussion related to SageTV for unRAID/Docker. Questions, issues, problems, suggestions, etc. relating to SageTV for unRAID/Docker should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-04-2017, 05:16 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,515
SageTV Web + SSL + Reverse Proxy (Any interest?) (unRAID only)

I've done this a couple times, now, where I'm using the "Let's Encyrpt" docker app (in unRAID), and it gets a free, and valid, ssl certificate for my server, and then I'm using it's configuration to reverse proxy my SageTV server.

The process is fairly simple, but not sure if anyone is interested in doing the same. I can try to find some time to document the steps, if there's interest.

I'm using duckdns to get a free "dyn dns" host that points to my home home router, and Let's encrypt, can work with those types of dynamic dns setups. The end result is that when I now go to my home server I get the "green" ssl secure enabled icon in the browser, since the certificates are valid.

EDIT: Here's a guide on using unRAID's Let's Encrypt containter and reverse proxying SageTV

https://github.com/stuckless/sagetv-...verse_Proxy.md

Last edited by stuckless; 06-06-2017 at 05:45 PM.
Reply With Quote
  #2  
Old 06-04-2017, 06:46 PM
alfi33 alfi33 is offline
Sage Aficionado
 
Join Date: Jun 2008
Posts: 297
Great timing! I already use the LetsEncrypt Docker to get to Home Assistant running in a Docker and today I just started experimenting with it with Sage.

How are you doing username/password? Are you using the htpasswd password config in nginx or just the Sage web interface username/password (or something else)?

I think my preference would probably be to just use the htpasswd password config in nginx (and not have a password on the Sage web interface when accessed from my LAN) but I haven't found a way to remove password protection from the Sage web interface.
__________________
Server: SageTV v9 on unRAID Docker; i5-2400; 16GB RAM; 9TB storage array; SiliconDust HDHR3
Client: Windows7 Pro; AMD Athlon 64 X2 5000; Radeon HD 3200; 4GB RAM
Client: Windows10; Intel Core2Duo; AMD HD6450; 4GB RAM
Client: Windows10; Intel Core2Duo; AMD HD5450; 4GB RAM
Reply With Quote
  #3  
Old 06-04-2017, 09:19 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 989
Quote:
Originally Posted by stuckless View Post
I've done this a couple times, now, where I'm using the "Let's Encyrpt" docker app (in unRAID), and it gets a free, and valid, ssl certificate for my server, and then I'm using it's configuration to reverse proxy my SageTV server.

The process is fairly simple, but not sure if anyone is interested in doing the same. I can try to find some time to document the steps, if there's interest.

I'm using duckdns to get a free "dyn dns" host that points to my home home router, and Let's encrypt, can work with those types of dynamic dns setups. The end result is that when I now go to my home server I get the "green" ssl secure enabled icon in the browser, since the certificates are valid.
+100 YES! I think that it's important to have SSL even on the LAN and anything that makes it easy and recommended for people is good. This should be the default method for any communication including the mini client and sagex. If you don't believe me go to DEF CON and see how long it takes for your login to show up on the Wall of Sheep! That is maybe an extreme environment, but it shows what is possible in the real world.

I've used SSL in Jetty for years on my own dime, (and earlier with my own CA), but once Let's Encrypt came out I've been using it. I actually tried the Nginx/Let's Encrypt Docker this weekend as I am looking at moving to unRAID, but it was just not for me. While the Docker allows for subdomains I have multiple domains AND Nginx is one of the few things that I want fail-over for meaning Pacemaker/Heartbeat with a virtual IP which I do not see any way to do in an unRAID/Docker setup. So, Nginx along with dnsmasq and OpenVPN are in VMs.

(Note that the future 6.4 release of unRAID is supposed to have an overhaul of the HTTP GUI which supports SSL.)

Quote:
Originally Posted by alfi33 View Post
Great timing! I already use the LetsEncrypt Docker to get to Home Assistant running in a Docker and today I just started experimenting with it with Sage.

How are you doing username/password? Are you using the htpasswd password config in nginx or just the Sage web interface username/password (or something else)?

I think my preference would probably be to just use the htpasswd password config in nginx (and not have a password on the Sage web interface when accessed from my LAN) but I haven't found a way to remove password protection from the Sage web interface.
Note that Nginx allows you to pass basic authentication so you could put a rule in that does it for you if on the LAN and otherwise requires a login, (which could be an Nginx one with fail2ban protection). Personally I use SSL even on my LAN, but Let's Encrypt it makes it more of a pain to do certificates and keep them current if you do not have a way to automatically update them. Plus browsers like Chrome are flagging certificates with a lifetime of over a certain time period as unsafe even if you trust the CA. My next test is to use Nginx + Let's Encrypt as an SSL termination point for everything and have it connect on the back-end over SSL ignoring certificate lifetimes.
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #4  
Old 06-05-2017, 06:18 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,537
Yes, please document.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #5  
Old 06-05-2017, 06:19 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,537
Quote:
Originally Posted by KarylFStein View Post
... I think that it's important to have SSL even on the LAN...
Why is this?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #6  
Old 06-05-2017, 06:24 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,515
OK... this week I'll try to write up a simple guide on the steps that I used to set this up. There were some pitfalls that I hit along the way, so, I think having it documented would be good.

Quote:
Originally Posted by alfi33 View Post
How are you doing username/password? Are you using the htpasswd password config in nginx or just the Sage web interface username/password (or something else)?
Currently, because I wanted to test it out, I'm using the .htpasswd method and the sagetv authentication (so it prompts twice). Since I can't remove the authentication from Sage, I'll likely just configure the sagetv paths in nginx to not use authentication and simply rely on the built in authentication in sagetv.

I currently working on a complete overhaul of the web server in sagetv... been doing so for many months (a few hours here and there), and I'll definitely look at being able to disable the auth requirements on the web server. Personally, I'd rather let nginx do it, and like you, only require it when you coming from the internet, over ssl.

Quote:
Originally Posted by KarylFStein View Post
+100 YES! I think that it's important to have SSL even on the LAN and anything that makes it easy and recommended for people is good. This should be the default method for any communication including the mini client and sagex. If you don't believe me go to DEF CON and see how long it takes for your login to show up on the Wall of Sheep! That is maybe an extreme environment, but it shows what is possible in the real world.

I've used SSL in Jetty for years on my own dime, (and earlier with my own CA), but once Let's Encrypt came out I've been using it. I actually tried the Nginx/Let's Encrypt Docker this weekend as I am looking at moving to unRAID, but it was just not for me. While the Docker allows for subdomains I have multiple domains AND Nginx is one of the few things that I want fail-over for meaning Pacemaker/Heartbeat with a virtual IP which I do not see any way to do in an unRAID/Docker setup. So, Nginx along with dnsmasq and OpenVPN are in VMs.

(Note that the future 6.4 release of unRAID is supposed to have an overhaul of the HTTP GUI which supports SSL.)



Note that Nginx allows you to pass basic authentication so you could put a rule in that does it for you if on the LAN and otherwise requires a login, (which could be an Nginx one with fail2ban protection). Personally I use SSL even on my LAN, but Let's Encrypt it makes it more of a pain to do certificates and keep them current if you do not have a way to automatically update them. Plus browsers like Chrome are flagging certificates with a lifetime of over a certain time period as unsafe even if you trust the CA. My next test is to use Nginx + Let's Encrypt as an SSL termination point for everything and have it connect on the back-end over SSL ignoring certificate lifetimes.
BTW, I think the MiniClient uses encryption by default (it's not "ssl" since it doesn't run over http sockets), but, the miniclient does have encryption. Now, whether or not it's being used, is another story... I haven't verified it, but I did encryption in the code, even when I was doing the Android MiniClient.

I do think the "Let's Encrypt" container is good for 90% of people with minimal requirements. I first used it for my brother's business. I had setup an unRAID server for him, then we wanted FTP access for clients, so I setup CrushFTP, and then he complained that the "SSL" was unsafe, so I set up Let's Encrypt... I really love the versatility of unRAID (but that's another post/story).

After setting it up for him, I decided to do it for myself. I have zero experience with nginx, but I figured it out. Once you figure out the reverse proxy stuff, which is just a couple of lines of configuration, it becomes easy to repeat that for other paths on your network.

I'm not much of an IT person and I hate spending time maintaining stuff... so the "Let's Encrypt" container fits the bill perfectly for me.

I'll try to write up the details steps for this in the new few days.
Reply With Quote
  #7  
Old 06-05-2017, 07:35 AM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 989
Quote:
Originally Posted by wayner View Post
Why is this?
My background is security. We're a paranoid bunch of folks :).

Quote:
Originally Posted by stuckless View Post
Currently, because I wanted to test it out, I'm using the .htpasswd method and the sagetv authentication (so it prompts twice). Since I can't remove the authentication from Sage, I'll likely just configure the sagetv paths in nginx to not use authentication and simply rely on the built in authentication in sagetv.
Nginx can be configured to handle HTTP basic authentication, (see http://shairosenfeld.blogspot.com/search?q=nginx), or I imagine (not tried) you can just put it in the URL string e.g. http://user:pass@IP:port.

The Nginx Docker for unRAID also includes fail2ban.
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #8  
Old 06-05-2017, 07:42 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,515
Quote:
Originally Posted by KarylFStein View Post
My background is security. We're a paranoid bunch of folks .



Nginx can be configured to handle HTTP basic authentication, (see http://shairosenfeld.blogspot.com/search?q=nginx), or I imagine (not tried) you can just put it in the URL string e.g. http://userass@IPort.

The Nginx Docker for unRAID also includes fail2ban.
I see... I could set the Authorization header in the proxy config, something like this..

Code:
proxy_set_header Authorization "Basic a2luZzppc25ha2Vk";
That's clever.
Reply With Quote
  #9  
Old 06-06-2017, 02:56 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,537
I am trying to get Reverse Proxying working on Apache to allow me access to my SageTV server(s) and other web content over a regular connection on port 80. This should allow me to access these sites even when a network (like your work network, etc) blocks most/all ports other than 80.

I am able to get through to the home page but I appear to be having problems getting the menus for the SageTV web UI to show up and accessing child pages and I think this has something to do with relative paths.

What I want to do is something like this - when you go to htt://myserver/sage1 it would redirect you to 192.168.1.99:7070 and then it would also redirect all relative paths, such as htt://myserver/sage1/sage/RecordingSchedule to 192.168.1.99:7070/sage/RecordingSchedule. (Note I left out the p in htt so it doesn't create automatic links.)

Does anyone know how to do this? Do I have to put in ProxyPass and ReverseProxyPass for all relative paths like /sage, etc?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #10  
Old 06-06-2017, 03:04 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
I had this trouble with Nginx. I had to point the virtual path /sage directly to Jetty's /sage path. Not the root path of my SageTV's Jetty. The reason is that many of the paths in the SageTV UI are static, not relative, and there's nothing we can do about that.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #11  
Old 06-06-2017, 05:33 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,537
Ok, I have it working better with the following in my config.

Code:
ProxyPass /sage1 http://192.168.1.99:7070
ProxyPassReverse /sage1 http://192.168.1.99:7070

ProxyPass /sage http://192.168.1.99:7070/sage
ProxyPassReverse /sage http://192.168.1.99:7070/sage

ProxyPass /sage1/sage http://192.168.1.99:7070/sage
ProxyPassReverse /sage1/sage http://192.168.1.99:7070/sage
The problem is that I can't do this to allow access to multiple sage servers since the second set of commands will send all references to /sage to my 192.168.1.99 server.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #12  
Old 06-06-2017, 05:46 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,515
SageTV Web Server + unRAID Let's Encrypt

Here's a quick guide... Hopefully it's thorough enough for people to follow.

https://github.com/stuckless/sagetv-...verse_Proxy.md
Reply With Quote
  #13  
Old 06-06-2017, 06:49 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,537
Thanks Sean - that's awesome.

One question - as a slight change to your methodology is there a risk in just setting your Sage web page to not require a user and password? Won't nginx stop anyone from outside your LAN - and I don't really care about authentication if the web access is coming from inside my LAN. Or am I missing something?

In addition, there is a driver for my Control4 HA system for Sage but it only works if you have no user/pass set for Sage.

I was also able to set this up to be able to access two Sage servers on my LAN with the following in my config file:
Code:
	location ^~ /sage {
		include /config/nginx/proxy.conf;
		proxy_pass http://192.168.1.99:7070/sage;
	}
	location ^~ /sage2 {
		include /config/nginx/proxy.conf;
		proxy_pass http://192.168.1.92:8080/sage;
	}
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #14  
Old 06-06-2017, 07:38 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,515
Quote:
Originally Posted by wayner View Post
Thanks Sean - that's awesome.

One question - as a slight change to your methodology is there a risk in just setting your Sage web page to not require a user and password? Won't nginx stop anyone from outside your LAN - and I don't really care about authentication if the web access is coming from inside my LAN. Or am I missing something?

In addition, there is a driver for my Control4 HA system for Sage but it only works if you have no user/pass set for Sage.

I was also able to set this up to be able to access two Sage servers on my LAN with the following in my config file:
Code:
	location ^~ /sage {
		include /config/nginx/proxy.conf;
		proxy_pass http://192.168.1.99:7070/sage;
	}
	location ^~ /sage2 {
		include /config/nginx/proxy.conf;
		proxy_pass http://192.168.1.92:8080/sage;
	}

To be honest... I'm not aware that you can tell Jetty to NOT require authenication in the setup that exists in SageTV today. If you could, then, sure, you can turn it off, if you are OK with people on the local network having full access (personally, I'd be ok with that). Connections from the internet will still require a username and password.

Also, you can reverse proxy the unRAID admin UI in the same manner, if you did want to expose it. I haven't done that myself... but I'm considering it... especially since the only time SageTV dies on my is when I travel, and using the unRAID UI I can easily restart it
Reply With Quote
  #15  
Old 06-06-2017, 08:03 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 989
You can also add location rules so Nginx will not prompt for a password on the LAN. I haven't done this, but I think you could do something like add the following to the location block, (using your own LAN subnet range of course):

Code:
   satisfy any;
   allow 192.168.1.0/24;
   allow 127.0.0.1;
   deny all;
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #16  
Old 06-06-2017, 08:16 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,537
You may be right - I tried to put in a blank user and password in the Sage UI and it didn't seem to work.

I have OpenVPN running on my router so that is how I would access my machine while travelling as my system is like yours - it only goes down when I am travelling. You might want to try that - you seem to have an Asus router and the Merlin firmware for Asus has OpenVPN server. Or you can run OpenVPN server in a docker

How would you do the config for nginx to reverse proxy other dockers that don't use a /dockername folder? For example, my Unifi controller docker just runs at 192.168.1.99:8443. How would I do the mapping for that?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #17  
Old 06-07-2017, 05:52 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,515
Quote:
Originally Posted by wayner View Post
You may be right - I tried to put in a blank user and password in the Sage UI and it didn't seem to work.

I have OpenVPN running on my router so that is how I would access my machine while travelling as my system is like yours - it only goes down when I am travelling. You might want to try that - you seem to have an Asus router and the Merlin firmware for Asus has OpenVPN server. Or you can run OpenVPN server in a docker

How would you do the config for nginx to reverse proxy other dockers that don't use a /dockername folder? For example, my Unifi controller docker just runs at 192.168.1.99:8443. How would I do the mapping for that?
I would think (and I haven't verified this)... but you could simply do something like...

Code:
location ^~ /unifi {
		include /config/nginx/proxy.conf;
		proxy_pass http://192.168.1.92:8443/;
	}
ie, this is similar to how you mapped /sage2/ to route to /sage/
Reply With Quote
  #18  
Old 06-07-2017, 07:17 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,537
That doesn't appear to work, but I will play around with it again tonight.

I was able to get it working properly for my rutorrent docker but I had to change the rutorrent/nginx config so that rutorrent is now located at http://tower:7777/rutorrent rather than http://tower:7777. It looks like this reverse proxying doesn't work as well when you want to hit the root path, or at least it takes a little more configuring if it does.

Similary I was able to get my Plex docker to work as a reverse proxy but I had to use the rather generic path of web as in http://tower:32400/web

And my sage2 doesn't totally work. Some of the links seem to be absolute so they still go to /sage as was mentioned by Taddeusz. So it is kind of weird that you can think you are looking at the WebUI for Server2 but when you click on a link you are actually operating on a file on Server1.

For example if I go to https://tower/sage2 it still takes me to Server1. But if I use https://tower/sage2/Home then I get to Server2. But some of the links at that page, such as the link for Upcoming recordings and all of the links for the menu bar, still map back to /sage. But other links, like the link for the UI Context under Currently Watching, or the detailed info for shows that are currently recorded or that are soon to be recorded, map to Sage2.

This reverse proxying is very useful for being able to access web sites where you can only hit basic ports like 443 or 80, but it seems like you are still much better off running VPN if you can. But you often can't do that - like when you are at work.

I wonder if all of this stuff will work better in the IPv6 world where every device has an "external" IP address and you can use port 80 or 443 for everything, you don't have to jerk around with using all of these different ports for different applications.

With unRAID it would be nice if you could create virtual IPs for every docker (isn't that what you do in a VM?) rather than having to map a couple of ports for every docker and you hope that you don't use the same port for multiple dockers, especially since not all of the ports you have used show up in that list when you are setting up a new docker.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #19  
Old 06-07-2017, 07:39 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,515
Quote:
Originally Posted by wayner View Post
That doesn't appear to work, but I will play around with it again tonight.

I was able to get it working properly for my rutorrent docker but I had to change the rutorrent/nginx config so that rutorrent is now located at http://tower:7777/rutorrent rather than http://tower:7777. It looks like this reverse proxying doesn't work as well when you want to hit the root path, or at least it takes a little more configuring if it does.

Similary I was able to get my Plex docker to work as a reverse proxy but I had to use the rather generic path of web as in http://tower:32400/web

And my sage2 doesn't totally work. Some of the links seem to be absolute so they still go to /sage as was mentioned by Taddeusz. So it is kind of weird that you can think you are looking at the WebUI for Server2 but when you click on a link you are actually operating on a file on Server1.

For example if I go to https://tower/sage2 it still takes me to Server1. But if I use https://tower/sage2/Home then I get to Server2. But some of the links at that page, such as the link for Upcoming recordings and all of the links for the menu bar, still map back to /sage. But other links, like the link for the UI Context under Currently Watching, or the detailed info for shows that are currently recorded or that are soon to be recorded, map to Sage2.

This reverse proxying is very useful for being able to access web sites where you can only hit basic ports like 443 or 80, but it seems like you are still much better off running VPN if you can. But you often can't do that - like when you are at work.

I wonder if all of this stuff will work better in the IPv6 world where every device has an "external" IP address and you can use port 80 or 443 for everything, you don't have to jerk around with using all of these different ports for different applications.
I would look at the sub_filter part of this stackoverflow answer... I think that's the key to having the response rewriten to account for the fact that the Jetty server does fully paths in the URLs. (You just need to know the actual hostort that the response is sending, and rewrite it...

https://stackoverflow.com/a/32543398/614231

Quote:
With unRAID it would be nice if you could create virtual IPs for every docker (isn't that what you do in a VM?) rather than having to map a couple of ports for every docker and you hope that you don't use the same port for multiple dockers, especially since not all of the ports you have used show up in that list when you are setting up a new docker.
Docker is meant to be a very lightweight container, so, it's shares lots of resources with the host. I think if you need more conrtol over networking, etc, you might need a heavyweight container, like a VM.

That being said, you can likely create multiple docker virtual interfaces... but not sure you can do that on the unraid environment... it tries to shield your pretty well from most docker things.
Reply With Quote
  #20  
Old 06-07-2017, 08:05 AM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 989
Quote:
Originally Posted by wayner View Post
That doesn't appear to work, but I will play around with it again tonight.

I was able to get it working properly for my rutorrent docker but I had to change the rutorrent/nginx config so that rutorrent is now located at http://tower:7777/rutorrent rather than http://tower:7777. It looks like this reverse proxying doesn't work as well when you want to hit the root path, or at least it takes a little more configuring if it does.

Similary I was able to get my Plex docker to work as a reverse proxy but I had to use the rather generic path of web as in http://tower:32400/web

And my sage2 doesn't totally work. Some of the links seem to be absolute so they still go to /sage as was mentioned by Taddeusz. So it is kind of weird that you can think you are looking at the WebUI for Server2 but when you click on a link you are actually operating on a file on Server1.

For example if I go to https://tower/sage2 it still takes me to Server1. But if I use https://tower/sage2/Home then I get to Server2. But some of the links at that page, such as the link for Upcoming recordings and all of the links for the menu bar, still map back to /sage. But other links, like the link for the UI Context under Currently Watching, or the detailed info for shows that are currently recorded or that are soon to be recorded, map to Sage2.

This reverse proxying is very useful for being able to access web sites where you can only hit basic ports like 443 or 80, but it seems like you are still much better off running VPN if you can. But you often can't do that - like when you are at work.

I wonder if all of this stuff will work better in the IPv6 world where every device has an "external" IP address and you can use port 80 or 443 for everything, you don't have to jerk around with using all of these different ports for different applications.

With unRAID it would be nice if you could create virtual IPs for every docker (isn't that what you do in a VM?) rather than having to map a couple of ports for every docker and you hope that you don't use the same port for multiple dockers, especially since not all of the ports you have used show up in that list when you are setting up a new docker.
I don't have a lot of time with Nginx under my belt and not somewhere I can test, but I think you want something like "location /unifi/ {" (trailing slash). If you also have a trailing slash on your proxy_pass line I believe it will strip /unifi/ from the URL string.

I haven't played with Sage web through Nginx yet, but in the past I've used rewrite rules in IIS to change the URL strings in responses. I'd be surprised if Nginx doesn't have something similar.

You might want to look at the Pipework docker for assigning a VIP to a docker container. Note that I haven't used this yet either. I'm still very early on in figuring out how to migrate all my configurations/capabilities to unRAID and the best way to do that...
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Siri Proxy for Voice Control of SageTV? wayner SageTV v7 Customizations 0 10-07-2013 10:12 PM
SageTV Online Services via HTTP-Proxy ? wubdich SageTV Software 4 02-16-2010 06:11 PM
Web user interface(s) related - reverse proxy jhh SageTV Customizations 10 08-03-2008 05:48 PM
Setting up sagetv with a proxy mattbrown1978 SageTV Software 1 06-03-2008 07:01 PM
SageTV freezes with lots of ff and reverse tomb18 SageTV Software 8 10-03-2006 08:48 PM


All times are GMT -6. The time now is 01:27 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.