New: Support for running from a sub folder (reverse proxy)

This commit is contained in:
Mark McDowall 2014-01-01 22:56:19 -08:00
parent cec479923f
commit b5c9a811dd
22 changed files with 161 additions and 89 deletions

View file

@ -31,6 +31,7 @@ namespace NzbDrone.Core.Configuration
string ApiKey { get; }
bool Torrent { get; }
string SslCertHash { get; }
string UrlBase { get; }
}
public class ConfigFileProvider : IConfigFileProvider
@ -152,6 +153,21 @@ namespace NzbDrone.Core.Configuration
get { return GetValue("SslCertHash", ""); }
}
public string UrlBase
{
get
{
var urlBase = GetValue("UrlBase", "");
if (String.IsNullOrEmpty(urlBase))
{
return urlBase;
}
return "/" + urlBase.Trim('/').ToLower();
}
}
public int GetValueInt(string key, int defaultValue)
{
return Convert.ToInt32(GetValue(key, defaultValue));