主要特性:高性能超过20,000连接并发(特定cpu多核的机器上,server新版本的190,000并发)多进程各种Nginxbug修复包括以下模块:ngx-coolkit-moduleecho-nginx-moduleset-misc-nginx-modulengx-postgres-modulengx-lua-moduleheaders-more-nginx-modulerds-json-nginx-module----------------------------------------------------------------------------------------------------nginx-openresty-windows1.9.9.1001发布,此版本更新内容如下:time:2016-01-1132bit:64bit:
----------------------------------------------------------------------------------------------------NginxOpenrestyWindowsv1.9.7.1002发布,升级各种模块。lastestreleaseVersion:1.9.7.100232bit:64bit:Releasetime:2015-12-05===================================================Changelog:updatengx_luamoduleto0.9.19updateheaders-more-nginx-moduleto0.28updatengx_lua_upstreammoduleto0.04updaterds-csv-nginx-moduleto0.07updatelua-cjsonmoduleto2.1.0.3updatelua-rds-parsermoduleto0.06updatelua-redis-parsermoduleto0.12updateLuaJITto2.1.0beta1nginx-openresty-windows1.9.4.1003下载地址:32bit:64bit:Releasetime:2015-09-24Changelog:1、lua_redis_parserandlua_rds_parsermoduleadded2、bugfix-when*occuredinincludedirectivenginxcrashed-----------------------------------------------------------------------------------------------------Version:1.9.4.100232bit:64bit:Releasetime:2015-09-15Changelog:whencompilenginxexportallthefunctionsthatrestyneeded,nowintotal49functionshavebeenexported-------------------------------------------------------------------------------------------------2015-08-20Version:1.7.10.232bit:64bit:Releasetime:2015-8-20Changelog:1、addconcatmoduleto32&64bitrespectively2、addredis2moduleto32&64bitrespectively3、addcjsonmoduleto32&64bitrespectively4、addlua51.dllruntimeforluajitfor32&64bitrespectively实现系统架构简图如下:
一、编写脚本
1、新建handle_cors.lua脚本文件
二、配置Nginx
1.配置nginx.conf信息
在server里对需要跨域的url添加
参考:https://blog.csdn.net/u010277446/article/details/78654491
踩坑:访问Openresty服务器时,使用postman、curl都是可以调通接口接收到正确响应的,但是在swagger-ui页面中执行execute时,总是返回403,“TypeError: Failed to fetch”!使用如下所示针对nginx的跨域配置是无效的,只有根据上述方法,使用lua脚本设置才起作用。
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*'
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000
add_header 'Content-Type' 'text/plaincharset=utf-8'
add_header 'Content-Length' 0
return 204
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)