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

Nginx - regex location

So I have a regex-based location rule, something like this: location ~ /(abc.*xyz|def.*zxy|ghk.*qwe)/ Can I check which part of regex yielded the match? Meaning that if the url was like /12abc34/ Than I'd like to know that it was matched…
Alex L.
  • 101
  • 11
0
votes
1 answer

nginx access_by_lua not respecting lua_package_path

I have a reverse nginx proxy running with the following in the nginx.config: http { lua_package_path ";;$prefix/?.lua;?.lua;/etc/nginx/?.lua;/etc/nginx/resty/?.lua;"; } and then multiple location in the server : # xxx SERVICE location ~*…
Scooby
  • 3,371
  • 8
  • 44
  • 84
0
votes
2 answers

NGINX virtual hosts with seperate lua_package_path variables

I'm trying to serve two (Openresty) Lua web applications as virtual hosts from NGINX which both require their own unique lua_package_path, but have a hard time getting the configuration right. # Failing example.conf http { lua_package_path =…
Gawin
  • 994
  • 10
  • 12
0
votes
0 answers

getting error when running resty-mongol in Lua through nginx

I am getting error when trying to running resty-mongol in Lua through nginx. The err is " attempt to index global 'bit' (a nil value)". My environment has https://github.com/openresty/lua-nginx-module/releases/tag/v0.10.6 - build with nginx 1.10.1…
Sumant Das
  • 19
  • 6
0
votes
1 answer

`popen` returning nil when reading within OpenResty

I've seen this manifest itself when including packages from torch. The simplest example is from the "sys" package. For some reason: https://github.com/torch/sys/blob/master/init.lua#L37-L40 is returning nil when launched through OpenResty which…
0
votes
2 answers

How to set user agent in request header and then pass it to wurfl

I am trying to use Wurfl plugin for Nginx. I am using Openresty instead of Vanilla Nginx. I don't get correct User-Agent set in the User-Agent header. So I am trying to set the User-Agent header myself while I process the request. But I feel that…
visingh
  • 233
  • 3
  • 17
0
votes
1 answer

Wrap origin public Dockerfile to manage build args, etc

I'm very new to Docker and stuff, so I wonder if I can change source official and public images from Docker.Hub (which I use in FROM directive) on-the-fly, while using them in my own container builds, kinda like chefs chef-rewind do? For example, if…
d.ansimov
  • 2,131
  • 2
  • 31
  • 54
0
votes
1 answer

How to pass to Nginx fastcgi_pass inside ngx_http_lua_module?

I need to pass an Nginx variable to my PHP 7.0 backend using the excellent library https://github.com/openresty/lua-nginx-module I prefer to use content_by_lua_block instead of set_by_lua_block, because the documentation for the 'set' function…
AaronDanielson
  • 2,230
  • 28
  • 29
0
votes
0 answers

Is there anything equivalent to middleware in Openresty or Lua web apps?

I'm learning Openresty for a small web app. Is there an abstraction layer Lua web apps and frameworks? For example: Python/WSGI, Ruby/Rack, Elixir/Plug. The most recent one I found for Lua seems out-of-date: APItools/lua-resty-rack There is also…
dgo.a
  • 2,634
  • 23
  • 35
0
votes
1 answer

LUA load JSON configuration from file

I'm trying to move old LUA method which was loading some JSON content from file into global variable into "class". But I get following errors all the time: attempt to call field 'decode' (a nil value) attempt to index global 'cjson' (a nil value) I…
SZMER
  • 183
  • 2
  • 15
0
votes
2 answers

Nginx unable to resolve IP Addresse set using lua plugin

I have setup nginx as a proxy server. It should basically forward the HTTP URL to particular IP address. The following is my configuration worker_processes 1; error_log logs/error.log; events { worker_connections 1024; } http { server { …
Rahul
  • 11,129
  • 17
  • 63
  • 76
0
votes
1 answer

How configure Lapis for external IP address?

I have installed Lapis with OpenResty. By default it works on localhost address. How to configure Lapis for exert IP? So I need that it works from my dedicated IP address
Gaga
  • 77
  • 2
  • 9
0
votes
1 answer

Strange io.popen behaviour in lua

I have lua block in nginx config, which checks for redis-server connection and if 4 java-processes are up, and then returns 200 or 500 status accordingly to this checks. location = /healthcheck { content_by_lua_block { local redis =…
d.ansimov
  • 2,131
  • 2
  • 31
  • 54
0
votes
0 answers

High latency after transferring Lua codebase from custom HTTP server to Nginx

For the past few years we have been running a custom, pre-forking, HTTP server written in C++, libevent and embedded Lua (LuaJit using the exact same LuaJit shared library that openresty, an Nginx package, uses). It's got almost the same…
Walt Howard
  • 7,676
  • 1
  • 16
  • 11
0
votes
1 answer

NGINX and Lua scripting: conditional use in content_by_lua

I'm trying to create a conditional content_by_lua script, where the content should be set by lua only under a turthy condition. example: nginx.conf location / { content_by_lua_file /nginx/lua/nginx.lua; root /nginx/www; …
Ben Diamant
  • 6,186
  • 4
  • 35
  • 50
1 2 3
31
32