mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-27 09:26:36 +00:00
Set the scheme from YT_POT_BGUTIL_BASE_URL
This commit is contained in:
parent
5f797d0915
commit
0919b03143
@ -11,8 +11,18 @@ server {
|
||||
# Server domain name
|
||||
server_name _;
|
||||
|
||||
set_by_lua_block $pot_url_scheme {
|
||||
local haystack = os.getenv('YT_POT_BGUTIL_BASE_URL') or ''
|
||||
local needle = 'https://'
|
||||
local scheme = 'http'
|
||||
if haystack:sub(1, #needle) == needle then
|
||||
scheme = 'https'
|
||||
end
|
||||
return scheme
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://token_server;
|
||||
proxy_pass $pot_url_scheme://token_server;
|
||||
proxy_redirect default;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user