Comments (9)
这个没有 其他 代替 方案么? openresty 使用了 nginx 本身的导出函数去实现自己的功能,但与linux不同, 在windows 上所有的 函数都是默认不可见的,所以就没办法调用 ngx_http_lua_ffi_var_get 了。
这里估计要不止一两个 函数 的问题。需要清算一下 resty 里边一共使用了多少函数,我们一次把他们都做导出,估计需要更多的时间去完成,感谢您的建议,我们会尽快完成这部分功能。
from nginx-openresty-windows.
能否先将下面代码涉及到的先处理了。谢谢
local container_url = ngx.var.container_url
local host = ngx.var.host
-- Check if key exists in local cache
local cache = ngx.shared.ceryx
local res, flags = cache:get(host)
if res then
ngx.var.container_url = res
return
end
local redis = require "resty.redis"
local red = redis:new()
red:set_timeout(100) -- 100 ms
local redis_host = os.getenv("CERYX_REDIS_HOST")
if not redis_host then redis_host = "127.0.0.1" end
local redis_port = os.getenv("CERYX_REDIS_PORT")
if not redis_port then redis_port = 6379 end
local res, err = red:connect(redis_host, redis_port)
-- Return if could not connect to Redis
if not res then
return
end
-- Construct Redis key
local prefix = os.getenv("CERYX_REDIS_PREFIX")
if not prefix then prefix = "ceryx" end
local key = prefix .. ":routes:" .. host
-- Try to get target for host
res, err = red:get(key)
if not res or res == ngx.null then
-- Construct Redis key for $wildcard
key = prefix .. ":routes:$wildcard"
res, err = red:get(key)
if not res or res == ngx.null then
return
end
ngx.var.container_url = res
return
end
-- Save found key to local cache for 5 seconds
cache:set(host, res, 5)
ngx.var.container_url = res
from nginx-openresty-windows.
我先看看,我目前只能出一个一揽子解决方案,具体的细节估计还没办法细看。抱歉哈。
from nginx-openresty-windows.
请问为什么ngx.var.xxxx为何调用了resty/core/var的代码呢,这个是ngx_lua package ngx自带的API,也就是说在C代码里面实现了的,请问您的配置是怎样的。
from nginx-openresty-windows.
Hi,@pinghe 能留个联系方式么?
from nginx-openresty-windows.
@pinghe 现在nginx.exe共导出resty所需的全部函数,因此该问题已经修复,请验证。
THANKS
from nginx-openresty-windows.
多谢,今天在飞机上,没能及时回复。已验证了Openresty_For_Windows_1.9.4.1002_64Bit版本,问题已解决。
此外,在nginx.conf 中如果是
include ../sites-enabled/*;
会报错
2015/09/15 21:43:50 [error] 10808#11256: ReadFile() "D:\temp\openresty\nginx1.9.4/conf/../sites-enabled/.." failed (1: Incorrect function)
如果明确指明了文件名,则不会报错
include ../sites-enabled/ceryx.conf;
在1.9.3.1001 1.7.10.2 都有这个问题。openresty版本在linux环境下没有问题。
from nginx-openresty-windows.
@pinghe 您好,看错误日志应该是使用Windows的FindNextFile遍历文件夹的时候遍历到.这个目录了,也就是本目录,建议使用_.conf来代替_或者_._,这个问题我明天回公司查一下代码,看看能否修正。
THANKS
from nginx-openresty-windows.
@pinghe 不好意思看到星号没有显示出来,建议使用星号点conf来代替星号,应该是可以的。
from nginx-openresty-windows.
Related Issues (20)
- 支持 IOCP 吗? HOT 4
- Nginx never start HOT 17
- 我想给nginx添加几个模块,有没有编译文档 HOT 5
- 请问这个要怎么解决? HOT 2
- 网盘下载不了? HOT 1
- lua file system不考虑支持下么.我用官方下的dll貌似不能正确加载呢 HOT 4
- ---------- HOT 8
- How to kill all of the nginx process? HOT 3
- balancer.set_timeouts()运行出错cannot resolve symbol 'ngx_http_lua_ffi_balancer_set_timeouts HOT 2
- Download Link down can you check address ? HOT 3
- iocp版怎么配置呢? HOT 7
- 我想把stream-lua-nginx-module模块编译进去,请问有没有编译好的版本或者编译编译文档? HOT 4
- nginx0.5.6至1.12.0,...等多版本存在信息泄漏漏洞 x1 HOT 4
- 请问一下你的objs/makefile文件是用工具生成的还是手工写的?如果手工写的话,添加一个模块岂不是很麻烦?如果是工具的话,请问用的啥工具? HOT 5
- 我在添加stream-lua-nginx-module模块的时候遇到这样的报错,请问你有遇到过吗?在nmake阶段的时候 HOT 3
- iocp版,IOCP下反向代理缓存模式,不能稳定访问 HOT 1
- 这个版本还发布么nginx都更新好多版本了,这个为啥没更新的? HOT 1
- 请问ngx cache purge 这个模块是否有考虑加入这个版本啊 HOT 1
- 工程项目能用 VS2013编译吗? HOT 1
- IOCP_1.11.5.1001 32位和64位版,访问postgres模块,nginx.exe会卡死,浏览器一直等待
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 nginx-openresty-windows.