-
Notifications
You must be signed in to change notification settings - Fork 692
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #403 from midoks/dev
0.14.1
- Loading branch information
Showing
26 changed files
with
3,788 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## 指定共享内存 | ||
lua_shared_dict healthcheck 10m; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
location / { | ||
proxy_pass http://{$UPSTREAM_NAME}; | ||
|
||
client_max_body_size 10m; | ||
client_body_buffer_size 128k; | ||
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Host $proxy_host; | ||
proxy_connect_timeout 90; | ||
proxy_send_timeout 90; | ||
proxy_read_timeout 90; | ||
proxy_buffer_size 4k; | ||
proxy_buffers 4 32k; | ||
proxy_busy_buffers_size 64k; | ||
proxy_temp_file_write_size 64k; | ||
} | ||
|
||
|
||
#location /upstream_status { | ||
# allow 127.0.0.1; | ||
# deny all; | ||
# access_log off; | ||
# default_type text/plain; | ||
# content_by_lua_block { | ||
# local hc = require "resty.upstream.healthcheck" | ||
# ngx.say("OpenResty Worker PID: ", ngx.worker.pid()) | ||
# ngx.print(hc.status_page()) | ||
# } | ||
#} | ||
|
||
location /upstream_status_{$UPSTREAM_NAME} { | ||
allow 127.0.0.1; | ||
deny all; | ||
access_log off; | ||
default_type text/plain; | ||
content_by_lua_block { | ||
local json = require "cjson" | ||
local ok, upstream = pcall(require, "ngx.upstream") | ||
if not ok then | ||
ngx.print("[]") | ||
return | ||
end | ||
|
||
local get_primary_peers = upstream.get_primary_peers | ||
local get_backup_peers = upstream.get_backup_peers | ||
local upstream_name = "{$UPSTREAM_NAME}" | ||
|
||
peers, err = get_primary_peers(upstream_name) | ||
if not peers then | ||
ngx.print("[]") | ||
return | ||
end | ||
|
||
peers_backup, err = get_backup_peers(upstream_name) | ||
if peers_backup then | ||
for k, v in pairs(peers_backup) do | ||
table.insert(peers,v) | ||
end | ||
end | ||
|
||
ngx.print(json.encode(peers)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
upstream {$UPSTREAM_NAME} | ||
{ | ||
{$NODE_ALGO} | ||
{$NODE_SERVER_LIST} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div class="bt-form"> | ||
<div class="bt-w-main"> | ||
<div class="bt-w-menu"> | ||
<p class="bgw" onclick="pluginService('op_load_balance');">服务</p> | ||
<p onclick="loadBalanceList();">负载均衡</p> | ||
</div> | ||
<div class="bt-w-con pd15"> | ||
<div class="soft-man-con"></div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<script type="text/javascript" src="/plugins/file?name=op_load_balance&f=js/app.js"></script> | ||
<script type="text/javascript"> | ||
resetPluginWinWidth(800); | ||
resetPluginWinHeight(300); | ||
$.getScript( "/plugins/file?name=op_load_balance&f=js/app.js", function(){ | ||
pluginService('op_load_balance'); | ||
}); | ||
</script> |
Oops, something went wrong.