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
2
votes
1 answer

How do make an SSL Connection from a Kong serverless function using a client certificate

I'm trying to create a serverless function for Kong for authentication purposes. I'm required to use a client certificate to authenticate with the remote service that we have to use. I can't seem to get this working and there appears to be no…
blockcipher
  • 2,144
  • 4
  • 22
  • 35
2
votes
2 answers

Caching is not working in nginx using proxy_cache.

I'am trying to set up basic caching in my openresty nginx webserver. I have tried milion different combinations from many different tutorials, but I can't get it right. Here is my nginx.conf file user www-data; worker_processes 4; pid…
Donm
  • 41
  • 1
  • 8
2
votes
1 answer

OpenResty : Response

I want to capture http response body and send it to another endpoint using resty.http . Here is my config , I am not able to get the body inside the content_by_lua_block (it is null). The response body is printed in access.log but is not present…
user59813
  • 31
  • 1
  • 4
2
votes
1 answer

Nginx internally call another request and return that request data

I am using nginx and lua to parse my rest api (https://openresty-reference.readthedocs.io/en/latest/Lua_Nginx_API/) . I am trying to internally call another api inside my rest call which is a different server and return that response. But it is…
Cedric
  • 107
  • 15
2
votes
1 answer

What is TCP socket referred in lua nginx module?

In the Lua Nginx module docs about ngx.socket.tcp() (Link), it says: Creates and returns a TCP or stream-oriented Unix domain socket object (also known as one type of the "cosocket" objects) This TCP socket can be used to connect to remote host,…
Dauto98
  • 177
  • 3
  • 12
2
votes
2 answers

How to save whole response data to nginx error.log?

I want to get all the request and response details, and I'm considering save them to ngx.log. I use such code to save them, I want to get a length of 5000 chars from the response body, but in the error.log file, it only saved a part of the response…
Rick
  • 141
  • 2
  • 15
2
votes
1 answer

Lua entry thread aborted: runtime error bad argument #2 to 'tonumber' (number expected, got string)

Im using lapis framework and torch, sometimes the website showing internal server error when trying to load page, and the error from lapis is: [error] 3726#81246: *19 lua entry thread aborted: runtime error:…
2
votes
1 answer

Run an access_by_lua before an if

I'm trying to get some text from an api then proxy pass if it equals to something. After some testing, I discovered that the access_by_lua is getting executed after the if statement. Here's my current code: set $protectione 'disabled'; …
Jobine23
  • 129
  • 9
2
votes
3 answers

How to resolve IPs of AWS ELB in Openresty for every upstream

The problem we're having is that openresty nginx only resolves the IP of AWS ELBs at startup and then caches the IP forever (until it reloads). Since the AWS loadbalancer IP can change anytime, I am looking for a solution that can resolve the ELB…
Bilal Ahmad
  • 322
  • 5
  • 11
2
votes
1 answer

Docker + OpenResty - flexible configuration. How to?

I have the openresty application that deploys with docker. My docker file: FROM openresty/openresty:alpine-fat ARG APPLICATION_PATH="/srv/www/my-app" COPY nginx.conf /usr/local/openresty/nginx/conf RUN mkdir ${APPLICATION_PATH} I'm running…
user9669681
2
votes
2 answers

How to get lua variables back into nginx variables

I have a lua script that uses lua-resty to call another service via co-sockets. Now I would like to use the information from this call to route the request in nginx. nginx includes the lua script in access_by_lua* which sets the var like…
daniel
  • 47
  • 1
  • 6
2
votes
1 answer

Install resty.http with already installed openresty

I installed openresty-1.13.6.1 but it lacks 'resty.http' module. My openresty is installed in /usr/local/openresty and i need to integrate resty.http module with it. How to do it?
lonecoder
  • 23
  • 2
  • 5
2
votes
0 answers

How to test open file limit in Nginx

So i've been having some issues with our live Nginx servers reaching max open file limits in production. I've increased the number but was wondering how do I test reaching that open file limit in a test environment? Any ideas welcome Secondary…
WillBroadbent
  • 804
  • 2
  • 8
  • 22
2
votes
1 answer

OpenResty auto_ssl too long lua code block error

I'm using OpenResty with nginx to auto-obtain SSL certs from Let's Encrypt. There's a lua function where you can allow certain domains. In this function, I have a regex to whitelist my domains. After I add a certain amount (not sure the exact…
jeremywoertink
  • 2,281
  • 1
  • 23
  • 29
2
votes
2 answers

Nginx server variables

I've tried to find an example of the issue I'm facing but failed so far, so apologies if it's already been answered. Within an nginx config (could include lua, i've tried both), I want to be able to access a variable across multiple locations within…
godspeed20
  • 23
  • 3