Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
184 lines (169 sloc) 7.93 KB
location /newapi/ {
rewrite_by_lua_file /startalk/openresty/nginx/lua_app/checks/qim/checkchains.lua;
proxy_pass http://im_http_service_api/im_http_service/newapi/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /newapi/nck/ {
proxy_pass http://im_http_service_api/im_http_service/newapi/nck/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/ {
proxy_pass http://qtalk_api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /file/ {
proxy_pass http://qtalk_file/qfproxy/file/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /package/qtapi/nck/ {
proxy_pass http://im_http_service_api/im_http_service/newapi/nck/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /package/qtapi/ {
rewrite_by_lua_file /startalk/openresty/nginx/lua_app/checks/qim/checkchains.lua;
proxy_pass http://im_http_service_api/im_http_service/newapi/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /package/push/ {
rewrite_by_lua_file /startalk/openresty/nginx/lua_app/checks/qim/checkchains.lua;
proxy_pass http://push_service_api/push_service/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#location /package/push/ {
# default_type application/json;
# return 200 '{"ret":true,"errcode":0}';
#}
location /py/ {
proxy_pass http://search/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /startalk/management/find/ {
proxy_pass http://startalk_found/qtalk_background_management/startalk/management/find/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /static {
root /startalk/openresty/nginx/html;
}
location /startalk/management/resetPwd{
proxy_pass http://startalk_found/qtalk_background_management/startalk/management/resetPwd;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /web/{
proxy_pass http://startalk_web/;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /websocket/ {
proxy_pass http://startalk_websocket/websocket/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~* ^/startalk_nav(|/)$ {
content_by_lua '
local z_scheme = "https"
if ngx.var.server_port == 8080 then
local z_scheme = "http"
end
local yourdomain = "qtalk.test.org"
local cjson = require "cjson"
local rets = {}
rets["Login"] = {}
rets["Login"]["loginType"] = "password"
rets["baseaddess"] = {}
rets["baseaddess"]["simpleapiurl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port
rets["baseaddess"]["fileurl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port
rets["baseaddess"]["domain"] = yourdomain
local len = string.len ( yourdomain )
local za = 0
local index = {}
for k = 1, len do
if string.sub ( yourdomain, k, k ) == "." then
za = za + 1
table.insert ( index, k )
end
end
local zb = za - 1
local rootdomain = string.sub ( yourdomain, index[zb], len )
rets["baseaddess"]["domainhost"] = rootdomain
rets["baseaddess"]["xmpp"] = ngx.var.host
rets["baseaddess"]["xmppport"] = 5222
rets["baseaddess"]["xmppmport"] = 5222
rets["baseaddess"]["protobufPort"] = 5202
rets["baseaddess"]["protobufPcPort"] = 5202
rets["baseaddess"]["javaurl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port .. "/package"
rets["baseaddess"]["pubkey"] = "rsa_public_key"
rets["baseaddess"]["httpurl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port .. "/newapi"
rets["baseaddess"]["apiurl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port .. "/api"
rets["baseaddess"]["socketurl"] = "ws://" .. ngx.var.host .. ":5280/websocket"
rets["baseaddess"]["shareurl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port .. "/py/sharemsg"
rets["baseaddess"]["socketurl"] = "ws" .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port .. "/websocket"
rets["baseaddess"]["resetPwdUrl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port .. "/static/reterievepassword.html"
rets["imConfig"] = {}
rets["imConfig"]["RsaEncodeType"] = 1
rets["imConfig"]["showOrganizational"] = true
rets["imConfig"]["mail"] = ngx.var.host
rets["imConfig"]["foundConfigUrl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port .. "/startalk/management/find/get/navigation"
rets["ability"] = {}
rets["ability"]["searchurl"] = z_scheme .. "://" .. ngx.var.host .. ":" .. ngx.var.server_port .. "/py/search"
rets["ability"]["showmsgstat"] = true
rets["RNAndroidAbility"] = {}
rets["RNAndroidAbility"]["RNMineView"] = true
rets["RNAndroidAbility"]["RNGroupCardView"] = true
rets["RNAndroidAbility"]["RNPublicNumberListView"] = false
rets["RNAndroidAbility"]["RNAboutView"] = false
rets["RNAndroidAbility"]["RNGroupListView"] = false
rets["RNAndroidAbility"]["RNContactView"] = true
rets["RNAndroidAbility"]["RNSettingView"] = true
rets["RNAndroidAbility"]["NUserCardView"] = true
rets["RNAbility"] = {}
rets["RNAbility"]["RNMineView"] = true
rets["RNAbility"]["RNGroupCardView"] = true
rets["RNAbility"]["RNPublicNumberListView"] = true
rets["RNAbility"]["RNAboutView"] = false
rets["RNAbility"]["RNGroupListView"] = true
rets["RNAbility"]["RNContactView"] = true
rets["RNAbility"]["RNSettingView"] = true
rets["RNAbility"]["NUserCardView"] = true
rets["version"] = 1
--ngx.header["content-type"] = "text/plain;charset=utf-8"
--ngx.header["content-type"] = "text/json;charset=utf-8"
ngx.header["content-type"] = "application/json;charset=utf-8"
ngx.say ( cjson.encode ( rets ) )
';
}
You can’t perform that action at this time.