mirror of
https://github.com/SickGear/SickGear.git
synced 2025-03-16 17:47:43 +00:00
Don't add portnumber when restarting with reverse proxy enabled
This commit is contained in:
parent
9301d29433
commit
4f43349dee
4 changed files with 27 additions and 14 deletions
|
@ -314,6 +314,7 @@ def main():
|
||||||
'username': sickbeard.WEB_USERNAME,
|
'username': sickbeard.WEB_USERNAME,
|
||||||
'password': sickbeard.WEB_PASSWORD,
|
'password': sickbeard.WEB_PASSWORD,
|
||||||
'enable_https': sickbeard.ENABLE_HTTPS,
|
'enable_https': sickbeard.ENABLE_HTTPS,
|
||||||
|
'handle_reverse_proxy': sickbeard.HANDLE_REVERSE_PROXY,
|
||||||
'https_cert': sickbeard.HTTPS_CERT,
|
'https_cert': sickbeard.HTTPS_CERT,
|
||||||
'https_key': sickbeard.HTTPS_KEY,
|
'https_key': sickbeard.HTTPS_KEY,
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,14 +4,17 @@
|
||||||
#set curSBHost = $sbHost
|
#set curSBHost = $sbHost
|
||||||
#set curSBHttpPort = $sbHttpPort
|
#set curSBHttpPort = $sbHttpPort
|
||||||
#set curSBHttpsEnabled = $sbHttpsEnabled
|
#set curSBHttpsEnabled = $sbHttpsEnabled
|
||||||
|
#set curSBHandleReverseProxy = $sbHandleReverseProxy
|
||||||
#except NameMapper.NotFound:
|
#except NameMapper.NotFound:
|
||||||
#set curSBHost = "localhost"
|
#set curSBHost = "localhost"
|
||||||
#set curSBHttpPort = $sickbeard.WEB_PORT
|
#set curSBHttpPort = $sickbeard.WEB_PORT
|
||||||
#set curSBHttpsEnabled = "False"
|
#set curSBHttpsEnabled = "False"
|
||||||
|
#set curSBHandleReverseProxy = "False"
|
||||||
#end try
|
#end try
|
||||||
sbRoot = "$sbRoot";
|
sbRoot = "$sbRoot";
|
||||||
sbHttpPort = "$curSBHttpPort";
|
sbHttpPort = "$curSBHttpPort";
|
||||||
sbHttpsEnabled = "$curSBHttpsEnabled";
|
sbHttpsEnabled = "$curSBHttpsEnabled";
|
||||||
|
sbHandleReverseProxy = "$curSBHandleReverseProxy";
|
||||||
sbHost = "$curSBHost";
|
sbHost = "$curSBHost";
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
if (sbHttpsEnabled != "False" && sbHttpsEnabled != 0)
|
if (sbHandleReverseProxy != "False" && sbHandleReverseProxy != 0)
|
||||||
var sb_base_url = 'https://'+sbHost+':'+sbHttpPort+sbRoot;
|
// Don't add the port to the url if using reverse proxy
|
||||||
|
if (sbHttpsEnabled != "False" && sbHttpsEnabled != 0)
|
||||||
|
var sb_base_url = 'https://'+sbHost+sbRoot;
|
||||||
|
else
|
||||||
|
var sb_base_url = 'http://'+sbHost+sbRoot;
|
||||||
else
|
else
|
||||||
|
if (sbHttpsEnabled != "False" && sbHttpsEnabled != 0)
|
||||||
|
var sb_base_url = 'https://'+sbHost+':'+sbHttpPort+sbRoot;
|
||||||
|
else
|
||||||
var sb_base_url = 'http://'+sbHost+':'+sbHttpPort+sbRoot;
|
var sb_base_url = 'http://'+sbHost+':'+sbHttpPort+sbRoot;
|
||||||
|
|
||||||
var base_url = window.location.protocol+'//'+window.location.host+sbRoot;
|
var base_url = window.location.protocol+'//'+window.location.host+sbRoot;
|
||||||
|
|
|
@ -95,6 +95,8 @@ class PageTemplate(Template):
|
||||||
self.sbHttpPort = sickbeard.WEB_PORT
|
self.sbHttpPort = sickbeard.WEB_PORT
|
||||||
self.sbHttpsPort = sickbeard.WEB_PORT
|
self.sbHttpsPort = sickbeard.WEB_PORT
|
||||||
self.sbHttpsEnabled = sickbeard.ENABLE_HTTPS
|
self.sbHttpsEnabled = sickbeard.ENABLE_HTTPS
|
||||||
|
self.sbHandleReverseProxy = sickbeard.HANDLE_REVERSE_PROXY
|
||||||
|
|
||||||
if cherrypy.request.headers['Host'][0] == '[':
|
if cherrypy.request.headers['Host'][0] == '[':
|
||||||
self.sbHost = re.match("^\[.*\]", cherrypy.request.headers['Host'], re.X | re.M | re.S).group(0)
|
self.sbHost = re.match("^\[.*\]", cherrypy.request.headers['Host'], re.X | re.M | re.S).group(0)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue