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

Openresty/nginx ngx.say() starts download

When I use ngx.say() in Lua, to output something, it starts downloading in browser. Try this url - http://162.241.200.114 I don't know what I'm supposed to do to fix this Also how to check the domain name and subdomain for the request using Lua.
Dean
  • 427
  • 1
  • 4
  • 8
3
votes
2 answers

How to address weak etags conversion by nginx on gzip compression

I am trying to compress response bodies for certain endpoints using gzip in nginx. The problem is with nginx marking the upstream apps generated etags as weak(prefixed with "W/"). The upstream apps don't have weak etag support yet(spring version <…
skb
  • 41
  • 1
  • 6
3
votes
1 answer

OpenResty lua-resty-string: Unable to decrypt cipher encrypted by Crypto-JS (AES default)

https://github.com/openresty/lua-resty-string I am not able to decrypt back what was encrypted using Crypto-JS in browser Javascript / NodeJS: // Encrypt var ciphertext =…
Prakhar Mishra
  • 1,586
  • 4
  • 28
  • 52
3
votes
1 answer

Making an https tls request from openresty lua

I am trying to find a way to make a secure GET request from within my nginx/lua module out to a server to check an ingress call's authentication. There seems to be very little out there on how to do this. My current attempts center around using…
doktoroblivion
  • 428
  • 3
  • 14
3
votes
0 answers

How to install Lapis into a docker container?

I'm just getting started with the Lua framework called Lapis, but I encountered a problem when I tried to install it into a docker cointainer. I’m using the official OpenResty image (jessie), and want to extendmy Dockerfile with a “luarocks install…
Gabor
  • 31
  • 2
3
votes
3 answers

Kong - verify upstream ssl (ssl_proxy on)

I have sucessfully installed kong gateway for an API which load balance via upstream to multiple targets (application servers). Now, I have a self-signed certificate for my application servers, the ssl handshake should fail between kong and the…
knotito
  • 1,382
  • 1
  • 12
  • 18
3
votes
0 answers

How to use env vars with Openresty and Lua

I'm trying to use the environment variables with Openresty using Lua: worker_processes auto; events { worker_connections 1024; } env API_USERS; env API_ROLESTECHS; http{ server { set_by_lua $api_users 'return os.getenv("API_USERS")'; …
AFP_555
  • 2,392
  • 4
  • 25
  • 45
3
votes
0 answers

Impossible to compare variable strings in nginx?

I have a simple comparison, I have checked that the strings are identical hmac hashes (base64 encoded), however this statement returns true from some reason. Why is Nginx not able to compare the strings correctly? if ($cookie_AUTHORIZATION !=…
user1658296
  • 1,398
  • 2
  • 18
  • 46
3
votes
1 answer

Nginx-redis module returning string length along with the value from Redis

I am using redis2-nginx-module to serve html content stored as a value in redis. Following is the nginx config code to get value for a key from redis. redis2_query get $fullkey; redis2_pass …
Ajeet Khan
  • 8,582
  • 8
  • 42
  • 65
3
votes
1 answer

Redirect to same URL with Lua on Nginx (openresty setup)

I'm looking to modify a request header and redirect it in Lua, I've tried ngx.redirect("/") and ngx.exec("/") but I'm getting following error: attempt to call ngx.redirect after sending out the headers Is there a straightforward way to add a…
anshulv
  • 132
  • 1
  • 1
  • 9
3
votes
1 answer

Openresty torch module loading issue

I'm trying to use openresty with torch for a Rest api for a neural network. First query works, any query after that fails. Nginx Config workers processes 1; error_log logs/error.log; events { workers connections 1024 } http { server { …
3
votes
3 answers

ngx_lua how to remove http request header

There is a param named "RedirectURL" in http request header. I want to remove it in ngx_lua and then send this request to RedirectURL, here is some snippet in nginx.conf location /apiproxytest { set_by_lua $redirectURL ' …
SomnusLee
  • 401
  • 1
  • 6
  • 17
3
votes
1 answer

Add a key/value to Redis in Nginx

I would like to communicate with redis from nginx, in order to store in lists which requests have been made on images especially on images not founds that are proxied on another server. I installed OpenResty, in order to use redis2_query and…
N. Hodin
  • 1,056
  • 6
  • 12
3
votes
4 answers

call openresty's nginx.conf file while running service start/stop/restart nginx command

I am using nginx as web server to my Django project. I am using command sudo service nginx start/stop/restart to manage nginx server. Now i am using Openresty framework to implement Lua code into nginx server to handle Cache system. Openrestry…
Prashant Gaur
  • 9,540
  • 10
  • 49
  • 71
2
votes
1 answer

Why can't i use ngx.socket.tcp() in init_by_lua phase?

I need to read api definition from unix socket(postgresql) and set it as a variable in shared dict. Is there a reason why this is forbidden? local pg = pgmoon.new({ socket_type = "nginx", host = table.concat({"unix:",…
1 2
3
31 32