Questions tagged [openresty]

OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules, as well as most of their external dependencies.

OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules, as well as most of their external dependencies.

By taking advantage of various well-designed Nginx modules, OpenResty effectively turns the nginx server into a powerful web app server, in which the web developers can use the Lua programming language to script various existing nginx C modules and Lua modules and construct extremely high-performance web applications that are capable to handle 10K+ connections.

OpenResty aims to run your server-side web app completely in the Nginx server, leveraging Nginx's event model to do non-blocking I/O not only with the HTTP clients, but also with remote backends like MySQL, PostgreSQL, Memcached, and Redis.

OpenResty is not an Nginx fork. It is just a software bundle. Most of the patches applied to the Nginx core in OpenResty have already been submitted to the official Nginx team and most of the patches submitted have also been accepted. We are trying hard not to fork Nginx and always to use the latest best Nginx core from the official Nginx team.

Home: http://openresty.org/

474 questions
0
votes
1 answer

Openresty: ngx.var vs ngx.ctx

What's the use case differences between ngx.var and ngx.ctx? When should one use var vs ctx? Are there any performance differences one should know about?
Kousha
  • 32,871
  • 51
  • 172
  • 296
0
votes
1 answer

set_by_lua_block (and alike) always convert the type to string

I have the following: set_by_lua_block $tags { local cjson=require("cjson") return cjson.encode({language="english"}) } And then in the main app, I log this: logger.info(asString(ngx.var.tags)) logger.info(type(ngx.var.tags) This…
Kousha
  • 32,871
  • 51
  • 172
  • 296
0
votes
1 answer

How to use OpenResty (nginx) to reduce data access time

I need to use nginx to proxy to different backend server according to the configuration information in database. One way is to use another program to write data in Redis and using OpenResty to access data in Redis. To reduce access time, is there a…
witrus
  • 297
  • 1
  • 3
  • 13
0
votes
2 answers

Secure different types of unsecured applications by a reverse proxy

I'm currently working on a project with complex requirements and I do not feel comfortable with the solution I'm considering. The main idea is to secure existing applications (which do not include security themselves) without modifying them. These…
DoBl
  • 52
  • 6
0
votes
1 answer

openresty lua-resty-mysql can be used in log phase

ngx.socket.tcp can't be used in log phase according to doc. https://github.com/openresty/lua-nginx-module#ngxsockettcp but I tested and found that lua-resty-mysql, based in ngx.socket.tcp can be used in log phase, why ?
oyjh
  • 1,248
  • 1
  • 9
  • 20
0
votes
1 answer

Openresty LUA Mysql connection error

I have been using openresty lua and trying to connect to a mysql db running on my local host. But, I am not able to connect to it and I couldn't debug it as the lua mysql client is not giving any information about the error. -- -- Created by…
GAK
  • 1,018
  • 1
  • 14
  • 33
0
votes
1 answer

Set client ssl cert variables as request headers of the message in openresty

I am trying to create a router for internal testing. I am using openresty image RESTY_CONFIG_OPTIONS_MORE. As the messages we are sending from the client are binary and don't have any request headers, we are trying to extract the issuer and serial…
dirtyqwerty
  • 185
  • 2
  • 16
0
votes
1 answer

Latency issue with Elastic Beanstalk, Nginx-lua, micro-apps

I'm running into an issue with latency when using a set of micro-apps on EB with the load balancer. This issue is specifically with one nginx powered app trying to hit another app on ELB. If we hit the API using postman it's fast, but posting to the…
0
votes
0 answers

Nginx content_by_lua_block deletes request body?

I wanted to make some changes on existing nginx configuration. My previous configuration was like this: location /serviceprovider { proxy_pass http://localhost:8080; proxy_set_header Host $host; …
Joshgun
  • 372
  • 3
  • 16
0
votes
1 answer

lua-resty-http:connect method clarification

I've been implementing a kong plugin that needs to make HTTP requests to retrieve information to share it with the upstream services. There is an excellent library called lua-resty-http that can be used to make HTTP requests. The service that…
Andrés Soto
  • 954
  • 1
  • 10
  • 20
0
votes
1 answer

nginx OpenREsty handle requests

I have a nginx server that acts like a proxy between , client and server . I am using Lua nginx Module ( open resty), front end technology ( Angular) . and web service is implemented in the server side For some particular reasons , In the proxy i…
0
votes
0 answers

NginX - Define a global variable with random number as value

I need a variable in http block with a random number as value. How can we define a variable in http block, whose value is computed from a function? I tried calling function inside map directive, but that prints the function call as a literal. I…
Charanjeet Kaur
  • 1,199
  • 3
  • 14
  • 27
0
votes
2 answers

NGINX base location sub-paths each with different TLS certificate and key

Problem: Our NGINX implementation has a base location for several different operation types, e.g. /analytics, /topology, ...; and each has its own access_by_lua_file which cracks open a token that is passed in containing several things that must be…
doktoroblivion
  • 428
  • 3
  • 14
0
votes
2 answers

Install of openresty : nginx.pid not found

I try to install OpenResty 1.13.6.1 under CentOS 7. When I try to run openresty I get this error: [root@flo ~]# openresty -s reload nginx: [error] open() "/usr/local/openresty/nginx/logs/nginx.pid" failed (2: No such file or directory) When I look…
user9099802
  • 243
  • 2
  • 11
  • 19
0
votes
0 answers

Lua protobuf library with "oneof" support

I am looking for Lua-protobuf binding that supports all protobuf syntax like oneof. I tried a couple of available libraries but they don't support oneof. I will use it in openresty.
Nishant Kumar
  • 2,199
  • 2
  • 22
  • 43