Select the Reverse Proxy tab, click on Modify for the relevant domain, and add the section that starts with '#added start' and ends with '#added end'. This will resolve the issue.
#PROXY-START/
location ^~ /
{
#added start
set $well_known '';
if ( $uri ~ "^/.well-known/" ) {
set_by_lua_block $well_known {
--get path
local m,err = ngx.re.match(ngx.var.uri,"/.well-known/(.*)","isjo")
-- If the path matches
if m then
-- Splicing file path
local filename = ngx.var.document_root .. m[0]
-- Determine if the file path is legal
if not ngx.re.find(m[1],"\\\\./","isjo") then
-- Determine if the file exists
local is_exists = io.open(filename, "r")
if not is_exists then
-- Java project?
filename = "/www/wwwroot/java_node_ssl" .. m[0]
end
-- release
if is_exists then is_exists:close() end
-- read file
local fp = io.open(filename,'r')
if fp then
local file_body = fp:read("*a")
fp:close()
if file_body then
ngx.header['content-type'] = 'text/plain'
return file_body
end
end
end
end
return ""
}
}
if ( $well_known != "" ) {
return 200 $well_known;
}
#added end
proxy_pass https://www.website.com;
proxy_set_header Host www.website.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;
# proxy_hide_header Upgrade;
#Persistent connection related configuration
add_header X-Robots-Tag "noindex, nofollow" always;
add_header X-Cache $upstream_cache_status;
add_header 'Access-Control-Allow-Origin' *;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accep,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Requested-With';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE';
#Set Nginx Cache
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
expires 1m;
}
proxy_ignore_headers Set-Cookie Cache-Control expires;
proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 301 302 300m;
}
#PROXY-END/