Comments (7)
还需要其它配置吗
access.log 有数据 error.log没有任何错误
from orange.
resty 0.23
nginx version: openresty/1.15.8.2
built by gcc 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)
built with OpenSSL 1.1.0k 28 May 2019
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl/include' --add-module=../ngx_devel_kit-0.3.1rc1 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.15 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../ngx_stream_lua-0.0.7 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl/lib' --with-cc='ccache gcc -fdiagnostics-color=always' --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-dtrace-probes --with-stream --with-stream_ssl_preread_module --with-http_ssl_module
http_stub_status也有
from orange.
@boot-vue 试试请求你监听的端口,比如80 或者443
from orange.
@boot-vue 试试请求你监听的端口,比如80 或者443
比如服务器 2.2.2.2 , nginx.conf 里边配置了域名 443 https://www.baidu.com
http://2.2.2.2:9999 访问dashboard
https://www.baidu.com 一天怎么滴也有上万的请求 , 但是dashboard里 total request 一直都是 1 不变
orange start , access.log , error.log 都正常, 没有什么异常
from orange.
nginx.conf 大概就这样, https://www.baidu.com 访问了上万次也没反应
worker_processes auto;
user root;
events {
worker_connections 4096;
}
# optional: path of orange.conf
env ORANGE_CONF;
http {
resolver 8.8.8.8; # replace it with your favorite config
charset UTF-8;
include ./mime.types;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$request_time" "$ssl_protocol" "$ssl_cipher" "$http_x_forwarded_for"'
'"$upstream_addr" "$upstream_status" "$upstream_response_length" "$upstream_response_time"';
access_log ./logs/access.log main;
error_log ./logs/error.log error;
sendfile on;
keepalive_timeout 65;
upstream default_upstream {
server localhost:8001;
}
#
# Config client_body_buffer_size equal client_max_body_size for enforcing in-memory buffering of the whole request body
# ref: https://github.com/openresty/lua-nginx-module/issues/521
#
# official instruct docs http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
#
client_body_buffer_size 1m;
client_max_body_size 1m;
#----------------------------Orange configuration-----------------------------
lua_package_path "$prefix/deps/share/lua/5.1/?.lua;$prefix/deps/share/lua/5.1/orange/?.lua;$prefix/?.lua;/usr/share/lua/5.1/?.lua;/usr/local/lor/?.lua;;";
lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;$prefix/deps/lib/lua/5.1/?.so;/usr/lib64/lua/5.1/?.so;;";
lua_code_cache on;
lua_shared_dict orange_data 20m; # should not removed. used for orange data, e.g. plugins configurations..
lua_shared_dict status 1m; # used for global statistic, see plugin: stat
lua_shared_dict waf_status 1m; # used for waf statistic, see plugin: waf
lua_shared_dict monitor 10m; # used for url monitor statistic, see plugin: monitor
lua_shared_dict rate_limit 10m; # used for rate limiting count, see plugin: rate_limiting
lua_shared_dict property_rate_limiting 10m; # used for rate limiting count, see plugin: rate_limiting
init_by_lua_block {
local orange = require("orange.orange")
local env_orange_conf = os.getenv("ORANGE_CONF")
print(string.char(27) .. "[34m" .. "[INFO]" .. string.char(27).. "[0m", [[the env[ORANGE_CONF] is ]], env_orange_conf)
-- Here, you can also use the absolute path, eg: local confige_file = "/home/openresty/orange/conf/orange.conf"
local config_file = env_orange_conf or ngx.config.prefix().. "/conf/orange.conf"
local config, store = orange.init({
config = config_file
})
-- the orange context
context = {
orange = orange,
store = store,
config = config
}
}
init_worker_by_lua_block {
local orange = context.orange
orange.init_worker()
}
# main server
server {
listen 80;
#server_name my_domain.com;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location / {
set $upstream_host $host;
set $upstream_url 'http://default_upstream';
rewrite_by_lua_block {
local orange = context.orange
orange.redirect()
orange.rewrite()
}
access_by_lua_block {
local orange = context.orange
orange.access()
}
# proxy
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header Host $upstream_host;
proxy_pass $upstream_url;
header_filter_by_lua_block {
local orange = context.orange
orange.header_filter()
}
body_filter_by_lua_block {
local orange = context.orange
orange.body_filter()
}
log_by_lua_block {
local orange = context.orange
orange.log()
}
}
location /robots.txt {
return 200 'User-agent: *\nDisallow: /';
}
}
# default upstream server
server {
listen 8001;
server_name localhost 127.0.0.1;
access_log ./logs/default_upstream_access.log main;
error_log ./logs/default_upstream_error.log;
location / {
content_by_lua_block {
local json = require "cjson"
ngx.status = 200
ngx.say("Host: "..ngx.var.host .. " URI: " .. ngx.var.uri)
ngx.say('[Query Params]', json.encode(ngx.req.get_uri_args()))
ngx.req.read_body()
ngx.say('[Post Params]', json.encode(ngx.req.get_post_args()))
ngx.say('[Header Params]', json.encode(ngx.req.get_headers()))
}
}
}
# orange dashboard server
server {
listen 9999;
stub_status on;
#server_name localhost;
access_log ./logs/dashboard_access.log main;
error_log ./logs/dashboard_error.log info;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location /robots.txt {
return 200 'User-agent: *\nDisallow: /';
}
# dashboard的静态文件
location ~* /static/(.*) {
alias ./dashboard/static/$1;
}
location / {
set $template_root '';
content_by_lua_block {
context.views_path = ngx.config.prefix() .. "/dashboard/views"
local main = require("dashboard.main")
main:run()
}
}
}
# api server
server {
listen 7777;
#server_name localhost;
access_log ./logs/api_access.log main;
error_log ./logs/api_error.log info;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location /robots.txt {
return 200 'User-agent: *\nDisallow: /';
}
location / {
content_by_lua_block {
local main = require("api.main")
main:run()
}
}
}
# ----------------------------这里-----------------************
server {
listen 443 ssl;
server_name *.baidu.com;
ssl_certificate /xxxx;
ssl_certificate_key /xxxx;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root /xxxx;
try_files $uri /index.html;
}
}
}
from orange.
你可以仿照80
端口的server
代码块配置 @boot-vue,443里面缺了很多lua代码的回调
当然你也可以本地curl 127.0.0.1
看看80端口的效果
from orange.
你可以仿照
80
端口的server
代码块配置 @boot-vue,443里面缺了很多lua代码的回调当然你也可以本地
curl 127.0.0.1
看看80端口的效果
是 没仔细看 我以为原有的配置都是给orange用的 原来如此 thanks
from orange.
Related Issues (20)
- 对规则进行添加、删除时,如果将规则都删除完后,就没有添加按钮 继续添加新规则了
- 请问orange 0.9 dev版本大概什么时间,我想使用balancer插件的功能
- 分流插件 cookie 获取信息无效 HOT 10
- 分流插件中使用,Header中获取key时,key包含下划线_导致value获取失败 HOT 2
- 分流插件中规则条件有上限的限制 HOT 1
- 反复装了N遍,还是报这个错:/usr/local/bin/orange:38: module 'bin.main' not found: HOT 8
- 我想咨询下orange的集群模式。 HOT 1
- install-orange.sh 获取的luajit目录不对 HOT 1
- master进程启动失败,但worker进程启动正常
- persist插件不完整 HOT 1
- dashboard用户密码的sha256盐值是硬编码写死的
- 中文显示的问题? HOT 1
- 规则选项里面有一个日志按钮以及清除query指的是什么
- 这个项目是已经不维护了么 HOT 7
- Provide Orange java REST client
- 有没有加密解密的插件
- 本项目已经停止维护了吗
- 大佬,还能开发一套矿池吗? HOT 1
- 怎样安装在 Rocky Linux上
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orange.