0
votes
0answers
9 views

Nginx serves response with 200 even after calling ngx.exit()

I am trying to serve static content from S3. I am using nginx and lua script for its configuration. I am new to both nginx and lua. The task that I want to achieve is : Get request URL into nginx. ...
0
votes
0answers
30 views

Optimize performance of subs_filter or LUA gsub on Nginx for large streams

I need to make multiple substitutions on a page, served via Nginx. I know that standard sub_filter module doesn't work here, because is limited to a single substitution. So, I came up with two ...
2
votes
1answer
99 views

Sending data to statsd does not work in some locations with content_by_lua_file

Before Until recently I used nginx 1.4.x with zebrafishlabs/nginx-statsd as a reverse proxy for openresty (yet, I know, nginx behind nginx - keep reading please) with the following location nginx ...
0
votes
1answer
64 views

Nginx using mysql result as variable to be used in headers more module

Without going into too much detail we have a requirement for the following: a) Query a simple single column, single row result from mysql. b) Use this variable as part of a more headers module, ...
0
votes
0answers
100 views

Insert if upstream_cache_status

I have a piece of lua code that should be working only when response from upstream_cache_status is HIT, however I don't seem to be able to do this. I'm using nginx and a mongodb server here. I'm ...
0
votes
1answer
82 views

Running WSAPI on ngninx via FastCGI

Using Lua 5.2 with wsapi 1.6-1 and wsapi-fcgi 1.6-1 installed via luarocks, I have the following nginx configuration: server { listen 127.0.0.1:8080; server_name localhost; location / { ...
0
votes
1answer
267 views

Nginx: unknown directive “ngx.flush(true)”

I'm having some trouble by using the nginx devel (ndk) and lua-module. I compiled nginx-rpm using the following configuration: ./configure \ --prefix=%{_sysconfdir}/nginx/ \ ...
3
votes
1answer
373 views

nginx lua: os.execute waitpid() failed (10: No child processes)

So, I'm trying to execute a script on every request. I know how that sounds, this is for development environment. I've added this to my nginx config access_by_lua_file "/opt/nginx/git-magic.lua"; ...
3
votes
2answers
745 views

Nginx & Lua: Hacks, optimizations & observations

Following this post on using Lua to increase nginx’s flexibility and in reducing load on the web stack I am curious to know how people are using Lua to enhance nginx’s capability. Are there any ...
0
votes
1answer
828 views

Nginx (openresty) generating random numbers

I have openresty set up on a server (nginx bundle which includes the lua module) and I'm trying to create a script which has specific odds of setting a cookie on a user's browser. My code looks like ...
1
vote
0answers
156 views

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 ...