current location:Home > Technical Articles > Operation and Maintenance > Nginx

  • What is the processing flow of Nginx event-driven framework?
    What is the processing flow of Nginx event-driven framework?
    The ngx_event_process_init method of the ngx_event_core_module module does some initialization of the event module. This includes setting the handler corresponding to a read event such as "request connection" to the ngx_event_accept function, and adding this event to the epoll module. When a new connection event occurs, ngx_event_accept will be called. The general process is as follows: the worker process continuously calls the ngx_process_events_and_timers function in the ngx_worker_process_cycle method for processing.
    Nginx 1217 2023-05-13 13:34:06
  • How to optimize Nginx and Node.js for high-load networks
    How to optimize Nginx and Node.js for high-load networks
    If network optimization does not first understand the underlying transmission mechanisms of nginx and node.js and carry out targeted optimization, no matter how detailed the optimization of the two is, it may be in vain. Generally, nginx connects the client and upstream applications through tcpsocket. Our system has many thresholds and restrictions for tcp, which are set through kernel parameters. The default values ​​of these parameters are often set for general purposes and cannot meet the high traffic and short life requirements of web servers. Here are some parameters that are candidates for tuning tcp. To make them effective, you can place them in the /etc/sysctl.conf file, or put them in a new configuration file, such as /etc/sysctl.
    Nginx 1040 2023-05-13 13:31:06
  • How to use the nginx.vim tool for syntax highlighting and formatting to configure the nginx.conf file
    How to use the nginx.vim tool for syntax highlighting and formatting to configure the nginx.conf file
    I use tengine, the installation directory is /usr/local/tengine. 1. Download nginx.vim 2. Upload nginx.vim to ~/.vim/syntax/, and add the following content to the file ~/.vim/filetype.vim: aubufread,bufnewfile/etc/nginx/*,/ usr/local/nginx/conf/*if&ft==''|setfiletypenginx|endif (flexibly configured according to the nginx installation directory) If there are no directories and files, create them.
    Nginx 1584 2023-05-13 13:28:06
  • How to implement hidden jump in Nginx
    How to implement hidden jump in Nginx
    Nginx's hidden jump can jump the request to a page on another website, and the URL in the browser remains unchanged. Rewrite rules need to be used in Nginx configuration. Two examples are provided below to illustrate the configuration of this jump requirement: 1. Nginx hidden jump configuration example 1 jumps the request path https://jb51.net/data/test to https://jb51.com/ data/test/test.html page. server{listen443;server_namejb51.net;access_log/data/nginx/logs/jb51.net-
    Nginx 1902 2023-05-13 13:25:12
  • How to implement nginx multi-domain forwarding
    How to implement nginx multi-domain forwarding
    Basic concept DNSDNS is the abbreviation of DomainNameSystem, which is the domain name system. DNS is a service on the Internet, generally called domain name service or domain name resolution service. It mainly provides services for converting website domain names and IP addresses. Correspondence between domain names and IPs There is a one-to-one correspondence between domain names and IP addresses, but multiple domain names can correspond to the same IP address. Just like the relationship between a person's name and their ID number, it is obviously much easier to remember a person's name than their ID number. An IP address is a numerical address that identifies a user's site on the Internet. To make it easier to remember, domain names are used instead of IP addresses to represent site addresses. DNS resolves domain names into IP addresses so that they correspond one to one. DNS work
    Nginx 2520 2023-05-13 12:58:20
  • How to import nginx logs into elasticsearch
    How to import nginx logs into elasticsearch
    Collect nginx logs through filebeat and transfer them to logstash. After processing by logstash, they are written to elasticsearch. Filebeat is only responsible for collection work, while logstash completes log formatting, data replacement, splitting, and index creation after writing logs to elasticsearch. 1. Configure nginx log format log_formatmain'$remote_addr$http_x_forwarded_for[$time_local]$server_name$request'&#39
    Nginx 904 2023-05-13 12:52:11
  • How to solve the pitfall of nginx proxy socket.io service
    How to solve the pitfall of nginx proxy socket.io service
    nginx proxies two socket.io servers. The working mode of socket.io is polling and upgrading to websocket. When requesting services through nginx, a large number of 400 errors appear. Sometimes it can be upgraded to websocket, and sometimes it keeps reporting errors. But when accessing directly through ip+port, it is 100% successful. Analyzing sidsid is the key to our problem. When initially creating a connection (polling mode is simulating a long connection), the client will initiate such a request: https://***/?eio=3&transport=polling&t=154082071
    Nginx 2199 2023-05-13 12:43:13
  • How to deploy nginx, php and virtual host in CentOS environment
    How to deploy nginx, php and virtual host in CentOS environment
    os environment: centos6.1nginx: nginx-1.2.2php:php5.3.140, install dependency package copy code as follows: yuminstallopenssl-develpcre-develzlib-devellibjpeg-devellibpng-develfreetype-develgccmake1, add www user to execute nginx copy code as follows :useradd-m-r-s/sbin/nologin-d/opt/web/www2. Create a temporary directory and copy the code as follows: mkdir-p/var/tmp/n
    Nginx 851 2023-05-13 12:40:06
  • How to use nginx to implement distributed current limiting
    How to use nginx to implement distributed current limiting
    1. Introduction Generally, systems that are exposed to the outside world will receive a large number of requests during promotions or hacker attacks. In order to protect the system from being overwhelmed by the high concurrent traffic that arrives instantly, it is necessary to limit the current flow. 2. First deploy an externally exposed interface. The program I deployed here is a springboot project that exposes the following interface. It simply exposes a restful interface that returns helloworld with a get request. Deploy this program to the Linux server. I won’t go into details about the deployment steps. You can deploy it yourself on Baidu springboot. .Here I recommend an architecture learning and exchange group to everyone. Communication and learning group number: 575745314 will share some videos recorded by senior architects: there are sprin
    Nginx 1396 2023-05-13 12:07:14
  • How to implement if nesting in nginx
    How to implement if nesting in nginx
    nginx does not support if nesting, nor does it allow the use of logical judgments in ifs. The following error will be reported: nginx:[emerg]"if"directiveisnotallowed. When the business requires multiple conditional judgments, it can be achieved with the help of intermediate variables, such as: Our The website has multiple subdomain names on the PC side, but only one domain name on the mobile side. The corresponding relationship is as follows: www.test.com-->m.test.comsub1.test.com-->m.test.com/sub1sub2.test. com-->m.test.com/sub2sub3.test.c
    Nginx 2678 2023-05-13 12:01:15
  • How to install NGINX on RHEL6
    How to install NGINX on RHEL6
    1. Install dependency packages (select the installation directory and execute the command) yum-yinstallmakegccgcc-c++opensslopenssl-develpcre-develzlib-devel-y. For all questions, the default is yesinstall. Automatically install the dependency gcc used by make to compile binary files. Compiling c/c++ language with gcc-c++ requires the http module of PCREnginx to use pcre to parse regular expressions opensslnginx supports http and https protocols. openssl is a secure sockets layer cryptographic library that has cryptographic algorithms, commonly used keys and certificate encapsulation management functions.
    Nginx 1568 2023-05-13 11:52:22
  • How to restart nginx service in ubuntu
    How to restart nginx service in ubuntu
    1. Use the shortcut key [Ctrl+Alt+T] to open the terminal command mode. 2. You can restart the nginx service in the following ways. Method one, in the nginx executable directory sbin, enter the following command to restart/nginx-sreload#Restart method two, find the current nginx process number, and then enter the command: kill-HUP process number to restart the nginx service#ps-ef|grepnginx #Find the current nginx process number]#kill-TERM132#Kill the nginx process, 132 is the nginx process number
    Nginx 3648 2023-05-13 11:40:11
  • How to enable multi-site support and Nginx rewrite rule configuration in WordPress
    How to enable multi-site support and Nginx rewrite rule configuration in WordPress
    Multi-site can be used directly in wordpress 3.0 and above. It can: 1. Create multiple wordpress sites by only installing one wordpress program, which can be a subdomain name or a subdirectory. 2. You can have an independent blog backend and independent blog address. 3. The administrator can set which themes are open to the site. 4. Administrators can configure plug-ins for each site. 5. Multiple sites share the "user database table", that is, the tables wp_usermeta and wp_users, and the others are independent database tables. WordPress multi-site configuration method: 1. First, back up the database of the website to prevent recovery in case of accidents (generally can be ignored). 2. Open w
    Nginx 2276 2023-05-13 11:16:13
  • How to deploy Django through Nginx based on ubuntu
    How to deploy Django through Nginx based on ubuntu
    There are many ways to deploy Django, and nginx+uwsgi is one of the more common ways. In this way, our usual approach is to use nginx as the front-end of the server, which will receive all requests from the web and manage the requests in a unified manner. nginx handles all static requests by itself (this is nginx's strength). Then, nginx passes all non-static requests to django through uwsgi, which is processed by django, thus completing a web request. It can be seen that uwsgi functions like a bridge. Act as a bridge. 1. Install nginx. Nginx is a lightweight web server/reverse proxy server and e-mail server.
    Nginx 2075 2023-05-13 11:01:06
  • How to deploy Nginx+Apache and separate dynamic and static
    How to deploy Nginx+Apache and separate dynamic and static
    Introduction to nginx dynamic and static separation nginx has strong static processing capabilities, but insufficient dynamic processing capabilities. Therefore, dynamic and static separation technology is commonly used in enterprises. The dynamic and static separation of php static pages is handed over to nginx for processing. The dynamic pages are handed over to the php-fpm module or apache for processing. In the configuration of nginx, the location configuration section and regular matching are used to implement different processing methods for static and dynamic pages. Reverse proxy principle nginx can not only serve as a web server, but also has the functions of reverse proxy, load balancing and caching. nginx is implemented through the proxy module Proxy the client's request to the upstream server. At this time, the connection between nginx and the upstream server is through the http protocol ngi
    Nginx 1664 2023-05-13 10:49:05

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28