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
1
vote
1 answer

Using a client certificate in nginx subrequest with lua

I want to pass a client certificate to a subrequest with ngx.location.capture. However, with the following function, the client certificate seems to doesn't not get passed by the proxy. local function checkAuthentication(userRole) return…
Mime
  • 1,142
  • 1
  • 9
  • 20
1
vote
1 answer

Read client certificate subject in openresty

I am a newb in lua. I am using the openresty/openresty:1.21.4.1-3-alpine-fat image. The client sends its certificate in the request. I need to read the subject of the certificate to implement some business logic but I can't seem to be able to find…
froy001
  • 614
  • 7
  • 21
1
vote
0 answers

Openresty - Keycloak - lua-resty-openidc not working properly

I use Keycloak at my IAM provider, and would like to use OpenResty along with the lua-resty-openidc plugin to implement authentication for all my backend apps. Openresty will proxy_pass those apps for me. I have it almost working, so I only need…
user3742205
  • 41
  • 2
  • 5
1
vote
1 answer

SAML authenication in Openresty

I am able to do SAML based authentication for a single URL of the application. IDP login is redirected and login is successful. But unable to generalize for all API. But when I try to add auth_reqeust and generalize for all APIs I am getting "auth…
Manu
  • 1,379
  • 6
  • 24
  • 53
1
vote
0 answers

Is it possible to add a new location block inside kong proxy server?

I have an use-case where for a particular request with path say /test-abc, i want the request to go to S3 rather than kong and all requests with path other than /test-abc should flow to kong gateway. I tried adding the location block in…
Ashay Fernandes
  • 353
  • 4
  • 14
1
vote
1 answer

Which directive I can run before ssl_certificate_by_lua_block to get user-agent information in openresty

I am using OpenResty to generate SSL certificates dynamically. I am trying to find out the user-agent of request before running ssl_certificate_by_lua_block and decide If I want to continue with the request or not. I found out that…
Nagri
  • 3,008
  • 5
  • 34
  • 63
1
vote
2 answers

How to extract the datetime with optional microseconds musing patern matching

I need to come up with a pattern to match YYYY-MM-DDTHH:MM:SS.s+Z with the milliseconds part being optional. The regex is simple and looks like this: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?Z$ Which match these…
notorious.no
  • 4,919
  • 3
  • 20
  • 34
1
vote
0 answers

How to add lua support into nginx

Os: Linux, distribution: Debian (buster) Currently, we using nginx:1.14.2, and to support Lua we are using libnginx-mod-http-lua:1.14.2 package. We are working on upgrading Nginx to nginx:1.21.0 version and I'm unable to find the compatible…
raj_yadav
  • 11
  • 3
1
vote
0 answers

302 Redirects to Upstream Servers Nginx

I made a load balancer using Upstream. as follows. * * * upstream appservers { least_conn; server srv1.domain.com:443; server srv2.domain.com:443; } * * * server { listen 443 ssl http2; server_name…
1
vote
0 answers

duplicate variable declaration in nginx.conf using postgres_set

I'm new to openResty and my question might appear trivial, but nevertheless I need some advice on this issue I'm experiencing with the "postgres_set" directive: As soon as I define a variable whose value is set by "postgres_set" directive within two…
user1612798
  • 702
  • 1
  • 5
  • 8
1
vote
0 answers

Nginx/OpenResty in Docker - 99: Cannot assign requested address

I have an nginx proxy based on openresty (https://openresty.org/en/), which is running in a docker container. It's simple proxy like: proxy_pass https://foobarstorage1.z6.web.core.windows.net/; proxy_http_version 1.1; From time to…
klodoma
  • 4,181
  • 1
  • 31
  • 42
1
vote
0 answers

Error uploading file over a certain size: '"Not enough space" while reading response header from upstream'

I've recently encountered this error while uploading files to my server which are over a certain size. It is preceded by a warning which happens whether the error is encountered or not (i.e. the warning occurs also for successful smaller file…
Pointo Senshi
  • 541
  • 5
  • 17
1
vote
0 answers

nginx taking too long to respond

I have an nginx used mainly as a reverse proxy for a couple of upstream services. This nginx has a simple endpoint used for health checks: location /ping { return 200 '{"ping":"successful"}'; } The problem I'm having is that this ping takes too…
1
vote
0 answers

How do I get the path of the current nginx/openresty location in lua?

I have this location block: location /somewhere/ { access_by_lua_file /path/to/file.lua; add_header X-debug-message "Using location: /somewhere/" always; ... } and I would like to do two things: I would like to move the header setting…
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
1
vote
0 answers

Upgrade PHP version for nginx

I want to upgrade php version from 7.2 to 7.4 I did these commands and installed 7.4 on server sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php7.4-fpm when I wanted to update…
Alfredo
  • 21
  • 4