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

Updating data in string with Lua

There are different urls in user_data, I want to change all usernames and passwords in user_data to make them the same. Since the URL directories are different, I want to find the username and password first, starting from the end, and update it…
2
votes
1 answer

NGINX LUA Content-Length +1 Byte Lost

I am having an interesting bug and method issue Lua mentions that the js_content variable has a length of 80 bytes. But when I don't use the "Content-Length" header, firefox mentions that 81 bytes of data are transferred. I don't know where the +1…
SweetNGX
  • 153
  • 1
  • 9
2
votes
1 answer

proxy_pass request base on the result of another internal request via lua-nginx

I want to proxy_pass a request or return a response base on the result of an internal service. to accomplish this purpose I'm using openresty docker image Here is my nginx.conf: # nginx.vh.default.conf -- docker-openresty # # This file is…
Phoenix
  • 3,996
  • 4
  • 29
  • 40
2
votes
0 answers

how to http request with Lua when Nginx start and restart

I am using Lua Nginx module in my nginx server. I have a Lua script which is execute by init_worker_by_lua_file in nginx.conf so the script will execute when nginx start and restart. What the Lua script does is, it request rest api to some server…
thirdwave
  • 75
  • 1
  • 7
2
votes
0 answers

What is the best way to use Bearer token authentication along with Proxy Digest Authentication? Is it even possible?

We have few Web APIs accessible via Bearer token authentication flow. Now, we need to support these APIs with Proxy based authentication as well (e.g., Basic, Digest, NTLM). So far, I was able to test Bearer token authentication along with Basic…
2
votes
1 answer

nginx worker process always run only 1

I have following configuration with worker_process 4; But I noticed that it always hits only 1 worker. I am testing on a local Centos VM. I am doing curl http call on specific port and added a file with 1000 curl requests and ran them from multiple…
javadev
  • 41
  • 2
2
votes
1 answer

How to use kafka in lua (openresty)?

I am using a library in lua (openresty) to interact with kafka: github. Readme.md describes SSL support for kafka. To connect, I use the following code local kafka = producer: new (broker_list, {["producer.type"] = "async", ["ssl"] = true}). How do…
faksel
  • 125
  • 5
2
votes
2 answers

OpenResty disable TLS 1.0 and TLS 1.1 in auto genereated certs

Lately i was playing with openresty and lua-resty-auto-ssl and can't find how to disable TLS 1.0 and TLS 1.1, (and add ciphers). I just read whole internet twice, and found nothing. In nginx is simple one line ssl_protocols TLSv1.3 TLSv1.2; but its…
Abc Xyz
  • 1,184
  • 12
  • 13
2
votes
1 answer

Using multiple variables in Nginx request_uri

Good morning programmers, I'm trying to protect a file, and for that I just want to allow the request_uri that I define. Example: if ($request_uri !~* "d=123&y=456") { return 403; } In this case, that example works, but I would like to do…
jeffsp
  • 23
  • 4
2
votes
1 answer

Is it possible to have live reloading of lua scripts using openresty and docker?

I'm newish to LUA and want to practice some LUA scripting using nginx/openrestry. Is there a workflow where I can use docker that runs openresty, and link my laptops filesystem to my docker container such that when I make a change to my lua script,…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
2
votes
0 answers

Nginx slow static file serving after a period of inactivity

I have a nginx server deployed as a reverse proxy. everything works great if I regularly use the service. Issue happens when the nginx service that I have deployed is inactive or not used(NO REQUEST PROCOSSED) for few days. When I try to launch THE…
Divya
  • 31
  • 2
2
votes
1 answer

How to config nginx to only return the response from the proxy in case the content-type is correct?

location / { proxy_pass http://image_server:8000; } In normal case, the proxy server will return image/png. But in other cases (for example out of bandwidth), it will throw application/json (with 200 HTTP) instead of images. So how to…
user2477
  • 896
  • 2
  • 10
  • 23
2
votes
1 answer

Setting "Cache-Control" header with Kubernetes ingress

I have a kubernetes cluster running in AWS and am trying to modify the Cache Controller headers via the kubernetes ingress as such: --- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: example-ingress-lab-static namespace: lab …
thewooster
  • 807
  • 1
  • 9
  • 23
2
votes
1 answer

Trigger openidc authentication based on status code of upstream

I'm using lua-resty-openidc to implement a web UI that sits in front of my backend system. The backend provides a REST API, protected by an Authorization header containing a JWT. The frontend manages a session, and sends web users to an Identity…
mamacdon
  • 2,899
  • 2
  • 16
  • 16
2
votes
1 answer

sni-support-required-for-valid-ssl error with AWS EC2 instance while implementing ssl with openresty

I have built a web app app.mywebapp.com. I'm planning to implement white labeling for my users. User example website: userwebsite.com. I want to point their subdomain to my app. Example: dashboard.userwebsite.com should point to app.mywebapp.com…
Anirudh
  • 2,767
  • 5
  • 69
  • 119