Set the scheme from YT_POT_BGUTIL_BASE_URL
This commit is contained in:
1 parent
5f797d0915
commit
0919b03143
1 file changed
+11
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user