nginx allows for the creation of 3rd party modules which are directly integrated in the nginx server or created as dynamic modules (.so) and loaded at run time when necessary.
Questions tagged [nginx-module]
32 questions
51
votes
3 answers
How to write a Nginx module?
I'm trying to find tutorials on how to build a module/plugin for Nginx web server.
Can someone help please, I just can't seem to find the appropriate tutorials.

user63898
- 29,839
- 85
- 272
- 514
2
votes
1 answer
nginx "mail" & "stream" directive is not allowed in site-enabled/
I have a problem when I try to use the stream or mail directive with nginx.
I'm using nginx/1.16.1 & Ubuntu 18.04.4 LTS.
This is my nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include…

Stefan
- 115
- 1
- 15
1
vote
0 answers
NGINX module to edit request body
I am trying to create an NGINX module to inject a property into the request body (all the requests are JSON formated) to be sent to the upstream. The idea is to validate the bearer authentication token, get a property from the token and inject it…
1
vote
2 answers
add Nginx 1.20.1 GeoIP2 module
I'm trying to configure nginx to build the GeoIP2 module, by following this installation:
https://github.com/leev/ngx_http_geoip2_module
first I still didn't understand what is defrences between static and dynamic modules,
and why can't I just apt…

iTaMaR
- 189
- 2
- 10
1
vote
0 answers
'connection reset by peer' for large response body by nginx mirror module
I want to copy requests to another backend with ngx_http_mirror_module.
This is my nginx.conf.
Nginx version is 1.19.10
worker_processes 1;
error_log logs/error.log info;
events {
worker_connections 1024;
}
http {
include …

yyamada
- 11
- 1
1
vote
1 answer
nginx: [emerg] invalid port in url "https://x.x.x.x./live/rtmp/auth"?
I am getting this message after changing my auth url to https. Is there a way to change callback to https or is it not supported for on_publish directive ? FYI - ngixn is ssl enabled.

abhishek
- 11
- 2
1
vote
2 answers
How to install nginx without the modules in RedHat
I install nginx using Yum following these steps:
yum install epel-release
yum install nginx
The following is the output of nginx -V:
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.1.1c FIPS 28 May 2019 (running with…

mohamad masarwi
- 41
- 5
1
vote
1 answer
Wordpress nginx map value not working in cloudpanel.io
I want to set up WordPress Multisite Subdirectory rules but i get this error "Vhost is not valid."
map $uri $blogname{
~^(?P/[^/]+/)files/(.*) $blogpath ;
}
map $blogname $blogid{
default -999;
include…

xXxlazharxXx
- 433
- 4
- 8
1
vote
1 answer
Nginx limit upload speed
I use Nginx as the reverse proxy.
How to limit the upload speed in Nginx?

Spring
- 831
- 1
- 12
- 42
1
vote
0 answers
After using http_substitutions_filter module, nginx ignores `Range` http header
I recently try to use http_substitution_filter_module to filter and replace some content in my nginx server.
After I added the subs_filter rule, I can no longer use Range header to retrieve the part of file but the full content.
Example:
flag.txt in…

Tony Yang
- 21
- 2
- 4
1
vote
0 answers
Nginx map redirect capture regex/query string capture and redirect to new
I am trying to setup bulk redirections in nginx(openresty) with map directive but am facing some issues with capturing regex/query string from the source url and forward to destination url. below is like my setup
nginx.conf is…

PURUSH.B
- 11
- 2
1
vote
0 answers
Nginx module: how to redirect from filter?
I am writing a custom nginx module where I do some processing using filters. The setup of the filters looks like so:
static ngx_int_t ngx_http_mymodule_init(ngx_conf_t *cf)
{
ngx_http_next_header_filter = ngx_http_top_header_filter;
…

Ivan Stanev
- 133
- 1
- 11
1
vote
1 answer
Nginx module writing: how to forward request to server?
I'm using nginx as a reverse proxy and I have been trying to write an nginx module that would process incoming requests, and if it likes certain HTTP headers present in the request, nginx would allow the request to reach the protected server (behind…

Ivan Stanev
- 133
- 1
- 11
0
votes
1 answer
NGINX Module while Handling subrequest callback expected behvior when rc is NGX_AGAIN
Writing an NGINX module that is depending on subrequest call.
on the callback, I am getting rc=NGX_AGAIN with request->out=NULL, of course that mean I cannot get the content of the subrequest response.
In that case what is the expected behavior of…

dvhh
- 4,724
- 27
- 33
0
votes
1 answer
NGINX module with array command results in segmentation fault
Consider a simple NGINX module:
typedef struct {
ngx_array_t *claims;
} my_conf_t
static ngx_command_t my_commands[] = {
{ ngx_string("my_claims"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
…

Josh M.
- 26,437
- 24
- 119
- 200