search
HomeOperation and MaintenanceNginxHow to add new module to nginx?

How to add new module to nginx?

Jun 13, 2019 pm 06:22 PM
nginxmodule

How to add new module to nginx?

Steps to add a new module to nginx:

1. Download the module


git clone https://github.com/agentzh/echo-nginx-module

2. Put it into the specified location


mv echo-nginx-module-master /usr/local/src/nginx-1.8.1/echo-nginx-module

3. View the compiled parameters


/usr/local/nginx/sbin/nginx -V

The result is:

--user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6

4. Recompile


./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --add-module=/usr/local/src/nginx-1.8.1/echo-nginx-module --with-ipv6 
make

PS: Only make is required here, be sure not to execute make install, otherwise it will overwrite

5. Backup Original file


cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

6. Replace nginx binary file


cp /usr/local/src/nginx-1.8.1/objs/nginx /usr/local/nginx/sbin/nginx

7. Check and smoothly start nginx


ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/nginx(做软链,添加到环境变量)
nginx -t (检测配置文件)
nginx -s reload (平滑重启)

The above is the detailed content of How to add new module to nginx?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
nginx monitoring configuration filenginx monitoring configuration fileApr 14, 2025 am 06:36 AM

Nginx Monitoring Configuration File: events block: Controls connection processing, such as concurrency and multi-receive mechanisms. http block: Configure access logs, error logs, and performance-related settings. server block: Defines the virtual host, including the listening port, host name, and root directory. location block: Used for request forwarding (such as proxy and FastCGI), as well as cache configuration. Monitoring module: ngx_http_stub_status_module provides server status information, ngx_http_server_tokens_module adds server header.

nginx listener port 80nginx listener port 80Apr 14, 2025 am 06:33 AM

To make nginx listen to port 80, you need to modify the listen instruction in the configuration file to listen 80, and check the user permissions to ensure that you have root permissions. Finally, reload nginx and verify that the listening port is correct.

nginx listens to forward different applications on the same portnginx listens to forward different applications on the same portApr 14, 2025 am 06:30 AM

Nginx can be configured to listen to the same port and forward traffic to different applications based on request: create a virtual host configuration, specify the port and server name. Use the proxy_pass directive to set the forwarding target in the location block. Start a different application and make sure it is listening for incoming connections. Test the configuration, navigate to a different server name to verify traffic forwarding.

NGINX listens to domain names, not to listen to portsNGINX listens to domain names, not to listen to portsApr 14, 2025 am 06:21 AM

In order for NGINX to listen to domain names without listening to ports, it is necessary to configure it in the configuration file: 1. Configure the virtual host and specify the domain name to listen to; 2. Delete the default listening port; 3. Configure DNS resolution; 4. Restart NGINX. This way, NGINX will only listen to the domain name, improve security and enable SNI.

nginx listening ipv6nginx listening ipv6Apr 14, 2025 am 06:18 AM

To make Nginx listen for IPv6 addresses, configure the listen directive in the server block configuration and specify the IPv6 address as a parameter. The specific steps include: opening the Nginx configuration file, adding the server block configuration, configuring the listen instruction to specify the IPv6 address, saving the changes and restarting Nginx. If the website uses SSL/TLS, you also need to configure an SSL certificate for the IPv6 address.

Lei Jun shares his New Year's wishes: deliver 300,000 cars and 100 check-in times in the gymLei Jun shares his New Year's wishes: deliver 300,000 cars and 100 check-in times in the gymApr 13, 2025 pm 11:54 PM

At the beginning of the new year, Lei Jun shared three New Year's wishes for 2025 at the beginning of the new year, and this four and a half hours-long live broadcast attracted a lot of attention. Lei Jun’s three major wishes are: First, achieve the delivery target of 300,000 vehicles, alleviate the pressure, and no longer be caught up by progress. Second, have more travel time, enjoy the beautiful scenery from all over the world, taste special food, and conduct car testing in combination with work. Third, stick to fitness and plan to check in 100 times in the gym to strengthen your body. Lei Jun admitted in the live broadcast that he traveled around in 2024, with a compact schedule, so he often only stayed for a short time, making it difficult to experience the local culture in depth. For example, at the New North Speedway in Germany, he stayed for only 8 hours. Therefore, in the new year, he hopes to be able to better balance work and life and travel

Annual reputation masterpiece! No.9 Company's micro-film 'Memory Travel' won many authoritative awardsAnnual reputation masterpiece! No.9 Company's micro-film 'Memory Travel' won many authoritative awardsApr 13, 2025 pm 11:51 PM

The micro-film "Memory Travel" created by No. 9 and brand spokesperson Yi Yang Qianxi won several authoritative media awards in 2024 and became a masterpiece of the year. This work has won high praise from the industry for its unique narrative style, exquisite production and sincere emotions. 2024 Awards and Honors: 2024 Gold Touch Global Business Innovation Award - Annual Film and Television Advertising 2024 China Advertising Marketing Award - Entertainment Marketing Group Silver Award 2024 Top Digital Innovation Marketing Award - Film and Television Production Gold Award 2024 Shanghai International Advertising Festival - Microfilm Silver Award 2024 The 11th China Innovation Communication Award - Integrated Marketing Silver Award WISE 2024 King of Business - Annual Case 31st China International Advertising Festival 2024 Digital Marketing Practical Big

Lead innovation and win another honor! AGON won the PConline2024 Zhizhen Technology AwardLead innovation and win another honor! AGON won the PConline2024 Zhizhen Technology AwardApr 13, 2025 pm 11:48 PM

Recently, the PConline2024 Zhizhen Technology Award was officially announced, and AGON Aidong QD-OLED e-sports display AG326UD won the "Technical Innovation of the Year" award. This honor not only represents the industry's high recognition of its technological advantages and market performance, but also fully reflects AGON's innovative capabilities and outstanding achievements in the field of e-sports display technology. 01. Looking at the future of technology, the authoritative value of the PConline Zhizhen Technology Award is the weather vane of the technology industry. The PConline Zhizhen Technology Award has successfully won wide industry recognition with its rigorous evaluation system and in-depth industry analysis. The award has always been committed to commending outstanding products and brands that promote the development of the technology industry, covering technology

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function