Questions tagged [lua]

Lua is a lightweight, embeddable, multi-paradigm, dynamically-typed programming languague.

55 questions
2
votes
1 answer

Passthrough captured request in nginx with lua

I'm doing something like this: location /foo { content_by_lua_block { local reqType = ngx.var.request_method if reqType == "POST" res = ngx.location.capture("/bar") else res…
IAmJulianAcosta
  • 293
  • 1
  • 3
  • 11
2
votes
1 answer

Nginx how to run shell script on page load via lua module os execute and then serve directory listing?

So I have a bash script that I want to execute/run on each "page load" of url so that it will modify (creating symlinks) to a /public/html/ folder that I want the server to then serve. The problem is I figured out how to do one or the other not…
htfree
  • 483
  • 4
  • 9
  • 21
2
votes
2 answers

How to improve call quality freeswitch?

Currently I have a system that makes use of FreeSWITCH for outbound calls via SIP External with flowroute and works well, but some users complain about the quality of the call. The system is running the call using a lua script, in which you create…
Sansa
  • 21
  • 1
  • 2
2
votes
0 answers

Lunajson not found in lua 5.2.3

I have installed lunajson with luarocks. When I attempt to use the module I keep getting the error below. I am just trying to decode a website that responds back with some json. The OS is running Debian Jessie. I know it is an older OS and I will…
user2236794
  • 139
  • 1
  • 3
1
vote
2 answers

How to install nginx mod lua on Amazon Linux 2?

I have an Amazon Linux 2 machine. I have installed NGINX with amazon-linux-extras install nginx1.12 How can I install nginx-mod-http-lua? I have tried: yum search lua and no packages are listed which look like what I want. This page…
Rich
  • 704
  • 14
  • 30
1
vote
1 answer

Lua missing socket.http module

I am using Lua with HAProxy. I have set LUA_PATH and LUA_CPATH as the…
Abrar Hossain
  • 133
  • 1
  • 9
1
vote
0 answers

rescore spam corpus with rspamd

I recently tried to rescore my spam/ham corpus with rspamds rescoring mechanism (see the example in "Corpus test and rescore tool"), but unfortunately this ends in a runtime error. My current minimal test-case is the following: echo test >…
tr9sh
  • 221
  • 2
  • 8
1
vote
1 answer

Unable to read a file and returns its result nginx

Using lua-nginx-module. And I'm unable to accomplish a thing wherein I'm want to modify the mtime of a file(touch.txt). I tried using .. os.execute("touch /app/directory/touch.txt") and this io.open('/app/directory/touch.txt','w').close() But…
Viren
  • 171
  • 1
  • 2
  • 10
1
vote
1 answer

Squid3 URLrewrite - Unable to configure

I have Squid3-3.4.8 on Debian Wheezy. It is performing caching duty. I just want to replace one jpg url to another URL in my local server or outside. I have tried solutions like Volta, squidred, asqredir. For Volta i'm stuck…
user359944
  • 11
  • 1
1
vote
0 answers

Lua flavored Nginx rewrite or internal redirection cycle

I'm new both to nginx and lua. I'm trying to follow this tutorial http://leafo.net/posts/creating_an_image_server.html#installation_requirements but for the life of me I can't get the nginx.conf right. I've checked other questions similar to this…
U r s u s
  • 121
  • 7
1
vote
1 answer

Fixing syntax errors in lighttpd.conf?

lighttpd newbie here... We're trying to set up lighttpd to host a local django app, kiosk-style. We intend to use wsgi for this, but we're having trouble figuring out the syntax for lighttpd's config file -- examples pulled straight from lighttpd…
Tom Corelis
  • 113
  • 6
1
vote
1 answer

how to configure http request pipeling using wrk?

I am trying to load test nodejs helloworld, which is running on system 1 at http://10.20.10.10:5000 and I want to pipeline http requests from system 2. wrk takes a script as a parameter. I am wondering what should be in the script pipeline.lua? Just…
RedFox
  • 111
  • 2
1
vote
1 answer

Nginx proxy_pass based on file extension and query string

I need to proxy_pass static assets (.js .css) based on file extension and query strings. For example: domain.com/foo.css - go to upstream1 domain.com/foo.css?V=1234 - go to upstream2 Reason is I have a 3 server setup - a router, an application…
1
vote
0 answers

Large scale custom domain support for a hosted web service

I am running a hosted platform for publishing Markdown documents. Currently I offer a subdomain per user, but the number one request right now is custom domains. My server stack is NGINX and uWSGI to handle user activities and reporting tools. The…
Jökull
  • 111
  • 3
1
vote
0 answers

Lua script does not close Nginx although ngx.close() defined

I am running a docker with lua-nginx image. In my Nginx conf file I call the lua script from server { } section: server { listen 80; server_name _; location /payload { content_by_lua_file /etc/nginx/handler.lua; proxy_pass…
jrz
  • 131
  • 3