All Projects → wujunze → Nginx Http Echo Module

wujunze / Nginx Http Echo Module

Licence: mit
A simple Nginx echo module

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Nginx Http Echo Module

Ngx php7
ngx_php7 - Embedded php7 scripting language for nginx module. Mainline development version of the ngx_php.
Stars: ✭ 337 (+75.52%)
Mutual labels:  nginx, nginx-module
Testcookie Nginx Module
simple robot mitigation module using cookie based challenge/response technique. Not supported any more.
Stars: ✭ 447 (+132.81%)
Mutual labels:  nginx, nginx-module
Nginx Opentracing
NGINX plugin for OpenTracing
Stars: ✭ 341 (+77.6%)
Mutual labels:  nginx, nginx-module
Shell
Infrastructure Management Shell - Linux
Stars: ✭ 381 (+98.44%)
Mutual labels:  gcc, nginx
Zstd Nginx Module
Nginx modules for the Zstandard compression
Stars: ✭ 64 (-66.67%)
Mutual labels:  nginx, nginx-module
Ngx php
ngx_php - Embedded php scripting language for nginx module. All released versions of the code repository.
Stars: ✭ 290 (+51.04%)
Mutual labels:  nginx, nginx-module
Nginx Tutorial
最全面,最深入的nginx从入门到精通的教程
Stars: ✭ 416 (+116.67%)
Mutual labels:  nginx, nginx-module
Nginx Module Vts
Nginx virtual host traffic status module
Stars: ✭ 2,518 (+1211.46%)
Mutual labels:  nginx, nginx-module
Ngx dynamic limit req module
The ngx_dynamic_limit_req_module module is used to dynamically lock IP and release it periodically.
Stars: ✭ 57 (-70.31%)
Mutual labels:  nginx, nginx-module
Nginx Nonewlines
This is an nginx module to strip the served HTML of all newlines (\n and \r characters)
Stars: ✭ 17 (-91.15%)
Mutual labels:  nginx, nginx-module
Nginx Module Sysguard
Nginx sysguard module
Stars: ✭ 568 (+195.83%)
Mutual labels:  nginx, nginx-module
Ngx healthcheck module
nginx module for upstream servers health check. support stream and http upstream. 该模块可以为Nginx提供主动式后端服务器健康检查的功能(同时支持四层和七层后端服务器的健康检测)
Stars: ✭ 145 (-24.48%)
Mutual labels:  nginx, nginx-module
Nginx Builder
A tool to build deb or rpm package of required Nginx version from the source code, with the ability to connect third-party modules. Nginx parameters are set in the yaml configuration file.
Stars: ✭ 123 (-35.94%)
Mutual labels:  nginx, nginx-module
Mod zip
Streaming ZIP archiver for nginx 📦
Stars: ✭ 178 (-7.29%)
Mutual labels:  nginx, nginx-module
Nginx Proxy Automation
Automated docker nginx proxy integrated with letsencrypt.
Stars: ✭ 2,302 (+1098.96%)
Mutual labels:  nginx
Lua Resty Redis Connector
Connection utilities for lua-resty-redis
Stars: ✭ 186 (-3.12%)
Mutual labels:  nginx
Ansible Collection Hardening
This Ansible collection provides battle tested hardening for Linux, SSH, nginx, MySQL
Stars: ✭ 2,543 (+1224.48%)
Mutual labels:  nginx
Xpcc
DEPRECATED, use our successor library https://modm.io instead
Stars: ✭ 177 (-7.81%)
Mutual labels:  gcc
External Auth Server
easy auth for reverse proxies
Stars: ✭ 189 (-1.56%)
Mutual labels:  nginx
Orange
OpenResty/Nginx Gateway for API Monitoring and Management.
Stars: ✭ 2,208 (+1050%)
Mutual labels:  nginx

Practical development Nginx Module

Build Status

简体中文

nginx_module_echo

echo string

Nginx Version

Nginx1.0.10 https://github.com/nginx/nginx/releases/tag/release-1.0.10 nginx1.0.10.png

The development environment configuration

OS : CentOS Linux release 7.2.1511 (Core)

Server_info.png Server_CPU_info.png

Install a clean compile Nginx

  1. Download a Nginx10.10 and unpack it nginx1.0.10.png

  2. Install the GCC and the lib Nginx need install_GCC.png Nginx_lib.png

  3. ./configure --prefix=/usr/local/nginx && make && make install configure_ok.png make && make install.png nginx_install_ok.png

  4. Nginx run start_nginx.png nginx_install_ok.png

Definition module configuration structure

typedef struct {
    ngx_str_t ed;  //该结构体定义在这里 https://github.com/nginx/nginx/blob/master/src/core/ngx_string.h
} ngx_http_echo_loc_conf_t;

define_moudle_conf.png

Define Nginx instruction and parameter conversion function

定义指令和参数转化函数.png

definition module Context

  1. Define the type of ngx_http_module_t structure variables 定义注入点结构体.png
  2. Initialize a configuration structure 初始化一个配置结构体.png
  3. Will the father block configuration information incorporated into this structure Implement the configuration of inheritance 合并父block的配置信息.png

Write the Handler really work part of the module

Nginx模块handler.png

Combination Nginx module

组合Nginx Module.png

Finishing module code According to the Nginx official specification

ok_file.png

Write the config file

ngx_addon_name=ngx_http_echo_module
HTTP_MODULES="$HTTP_MODULES ngx_http_echo_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_echo_module.c"

make && make install

 ./configure --prefix=/usr/local/nginx/ --add-module=/root/ngx_dev && make && make install

Successful installation

make install.png

Modify the Nginx configuration file test Module

test module.png

Nginx echo Module The successful running

module ok.png

If the repo help you welcome star fork Thanks!

reference

  1. http://wiki.nginx.org/Configuration
  2. http://tengine.taobao.org/book/
  3. http://blog.codinglabs.org/articles/intro-of-nginx-module-development.html
  4. https://www.nginx.com/resources/wiki/modules/
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].