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

Authenticate websocket with keycloak through openresty

Currently I have a working solution with following components: Webserver with custom application Openresty with lua Keycloak This allows me to authenticate using keycloak. Because my webserver also exposes a websocket host, I would like to…
4
votes
0 answers

how to rewrite response based on request body content in nginx?

I have requirement where i need to have a rewrite the response with static context in nginx based on content from the request body say "fruit":"apple", The nginx location with rewrite config as mentioned below, o tried referring to nginx…
Bharathan Kumaran
  • 981
  • 10
  • 22
4
votes
1 answer

Nginx Docker AWS, Nginx is not able to resolve 127.0.0.11 in multi container

What I am working on: nginx- openresty with mecached and docker-compose. from nginx I am able to connect memcached container by specifying resolver = 127.0.0.11, in docker compose it working file. But when I am deploying it on AWS multi container…
sandeep
  • 996
  • 2
  • 11
  • 22
4
votes
2 answers

ngx lua: scope of local variable, init in init_by_lua_block

I'm new to nginx lua, and got a setup from previous developer. Trying to go through the docs to understand the scope but I'm pretty unsure. It's like this right now init_by_lua_block { my_module = require 'my_module' …
Luan Nguyen
  • 134
  • 1
  • 7
4
votes
1 answer

Openresty nginx reload not working? (Updated variables are nil in lua file)

I'm currently passing some new variables into my lua file, it seems like these new variables are nil when I log them out and I removed my old variable called saveFileRootPath but the old variable still can be logged. Here is the a part of my nginx…
Joshua Rajandiran
  • 2,788
  • 7
  • 26
  • 53
4
votes
1 answer

Is it possible to consolidate multiple responses and send one response in NGINX

I have Nginx/openresty and some other services running on one VM. Basically VM accepts requests on Openresty and then openresty forwards requests to appropriate service. e.g. below requests getting forwarded to ServiceA, ServiceB and ServiceC…
YS_NE
  • 194
  • 2
  • 21
4
votes
1 answer

Kong API gateway v0.11.0 upstream_url

We are trying to set up a plugin that depends on the headers of the request, proxy it to an specific host. Ex. curl -H 'Env: foo' http://127.0.0.1:8000/poc -> https://foo.example.com/poc curl -H 'Env: bar' http://127.0.0.1:8000/poc ->…
4
votes
1 answer

Openresty Hello world with docker

I'm trying make my application dockerize for that I've been following official openresty dockerfile. Os in my system is Ubuntu 16.04 64 bit. I have already pull that image using this cmd. docker pull openresty/openresty:1.11.2.3-xenial Now I want…
Rahul
  • 1,013
  • 1
  • 10
  • 24
4
votes
1 answer

Share a LUA variable across requests in Lua-Resty (openresty)

I'm using OpenResty with lua-resty; and obviously for each request the program has its own variables. To share simple strings or configurations across requests I currently use lua-shared-dict. But, if I need to share and maintain a big variable…
Carmine Giangregorio
  • 943
  • 2
  • 14
  • 35
3
votes
1 answer

Why does rate limit not working when using with return directive in Nginx?

I had following nginx configuration: worker_processes 1; error_log logs/error.log; events { worker_connections 1024; } http { limit_req_zone $request_uri zone=by_uri_6000:10m rate=6000r/s; server { listen 80; server_name…
Wayne Hong
  • 33
  • 2
3
votes
1 answer

Assign the Lua function to Nginx variable

I would like to assign the value to the nginx variable. This is my sample code. location / { set $TOKEN; content_by_lua_block { result = io.popen("echo 'https://google.com'") # or any command that will return value to result …
zzob
  • 993
  • 3
  • 9
  • 19
3
votes
2 answers

What's the difference between OpenResty and Nginx?

As a novice web developer, I tend to use Nginx when deploying & running my Larvel PHP sites. I've recently come across OpenResty and, from what I believe, it appears to be webserver software like that of Nginx. As someone who is always looking to…
Ethan
  • 53
  • 1
  • 11
3
votes
2 answers

Nginx random variables

Good morning programmers, I'm trying to create random variables on nginx, (I have OpenResty nginx+lua). Here is an example of a static variable: set $teste 123; So is it possible to turn this static variable random?
xorhax5
  • 35
  • 1
  • 3
3
votes
1 answer

Sending http requests with Openresty to Google Analytics

I have been using openresty/nginx+lua to send server-side hits to Google Analytics Measurement Protocol. However, the function I'm using (ngx.location.capture) is incompatible with HTTP/2 and a "won't fix" issue. Apparently, the way to go is to use…
lucian
  • 623
  • 10
  • 21
3
votes
1 answer

changing nginx conf file

I installed openresty alpine docker image and mounted conf.d to define the server in there. It works fine. Next, I want to change nginx.conf and set worker_process=auto. However worker_processes are defined in nginx.conf. I tried to volume…
marcg
  • 552
  • 1
  • 8
  • 20
1
2
3
31 32