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

  • How to configure nginx multiple locations
    How to configure nginx multiple locations
    Preface Configuring multiple locations under nginxserver performs different processing according to different path matching. Commonly used regular expression syntax rules for nginx: The beginning of location[=|~|~*|^~]/uri/{…}= means: exact match. Starting with ^~ means: it is case-sensitive and starts with something. Starting with ~ means: case-sensitive regular matching. Starting with ~* means: case-insensitive regular matching. !~ and !~* respectively represent: case-sensitive non-matching and case-insensitive non-matching regular matching. / means: universal matching, any request will be matched. In the case of multiple location configurations, the matching order is (not verified): match = first, then
    Nginx 2601 2023-05-17 22:25:45
  • What is the command to install Nginx in Linux?
    What is the command to install Nginx in Linux?
    1. Install nginx, which depends on yum-yinstallgcczlibzlib-develpcre-developensslopenssl-devel2.wget download nginx. Download nginx in the newly created nginx folder. The version can be selected on the Nginx official website. I chose the latest and most stable version on the official website at the current point in time wgethttp:/ /nginx.org/download/nginx-1.22.0.tar.gz3. Decompress tar-zxvfnginx-1.22.0.tar.gz4. Automatic configuration #Enter the decompressed nginx directory cdnginx-1.22
    Nginx 1297 2023-05-17 21:58:04
  • How to check whether nginx is started in Linux system
    How to check whether nginx is started in Linux system
    The first method: View the process list and filter Each application running in Linux will generate a process, then we can determine whether the Nginx process is started by checking whether it exists. Use ps-ef to list the processes and then filter through grep. For example: ps-ef|grepnginx can see whether the Nginx process exists. The second method: directly check the process idps-Cnginx-opid. This method of directly returning the pid is more suitable for use in conjunction with other programs. For example, execute this command in a shell/python script to get the pid, and then determine whether Nginx is based on the pid. start up. This method is recommended. The third method: use nets
    Nginx 8497 2023-05-17 21:49:10
  • How to configure Nginx to list directories and files and control access permissions with passwords
    How to configure Nginx to list directories and files and control access permissions with passwords
    Use nginx to list directories Preparation - install nginx and create some directories and files: Copy the code as follows: $sudoapt-getinstallnginx$cd/usr/share/nginx$mkdirweb$sudomkdirdirectory{1,2,3}$sudotouchfile{1, 2,3}$lsdirectory1directory2directory3file1file2file3nginx configuration: Copy the code code as follows: $sudovim/etc/nginx/conf.d/list.confserver{l
    Nginx 1558 2023-05-17 21:49:04
  • Nginx basic knowledge introduction example analysis
    Nginx basic knowledge introduction example analysis
    nginx is a high-performance http and reverse proxy server known for its high stability, rich feature set, sample configuration files, and low system resource consumption. nginx features handle static files, index files and automatic indexing; open file descriptor buffering. Cacheless reverse proxy acceleration, simple load balancing and fault tolerance. fastcgi, simple load balancing and fault tolerance. Modular structure. Including filters such as gzipping, byteranges, chunkedresponses, and ssi-filter. If multiple SSIs present in a single page are processed by fastcgi or other proxy servers, this processing can run in parallel without waiting for each other.
    Nginx 1461 2023-05-17 21:48:23
  • How to configure Nginx to support websocket
    How to configure Nginx to support websocket
    1. Understanding of wss and nginx proxy wss: 1. The wss protocol is actually websocket+SSL, which means adding an SSL layer to the websocket protocol, similar to https (http+SSL). 2. Use nginx to proxy wss [Communication principle and process] The client initiates a wss connection and connects to nginx. Nginx converts the wss protocol data into ws protocol data and forwards it to the websocket protocol port of Workerman. After receiving the data, Workerman does business logic processing and Workerman gives it to the customer. When the client sends a message, the process is the opposite. The data is converted into wss protocol through nginx/ and then sent to the client. 2.
    Nginx 5464 2023-05-17 21:28:13
  • How to ban access to php in nginx
    How to ban access to php in nginx
    How to prohibit nginx from accessing php: 1. Configure nginx to prohibit parsing the specified program in the specified directory; 2. Change "location~^/images/.*\.(php|php5|sh|pl|py)${denyall. ..}" statement can be placed in the server tag. nginx site directory and file URL access control 1. Restrict program and file access based on extensions. Use nginx configuration to prohibit access to PHP, Shell, Perl, and Python program files in the uploaded resource directory. Configure nginx to prohibit parsing the specified program in the specified directory. location~^/images/.*\.(php|p
    Nginx 1202 2023-05-17 21:19:04
  • How to reverse proxy Nginx to Tomcat server
    How to reverse proxy Nginx to Tomcat server
    In actual production, tomcat servers are generally not used alone in projects. Nginx performs better in responding to static resources. In addition, since nginx is a server specifically used for reverse proxy, it is easy to forward Java requests to the backend. The client is handed over to the tomcat container for processing, and it is used to process static resources. In nginx, a server{} block is often used to configure a relatively large project. Generally, it is all the configurations of a domain name. There are usually multiple configurations in a server block. location to define multiple request rules, such as domain name and root directory configuration, static resource support, phpfastcgi request, url rewriting, error page configuration and other configurations, so
    Nginx 1495 2023-05-17 21:01:04
  • How to configure a Python web project using Nginx and uWSGI
    How to configure a Python web project using Nginx and uWSGI
    Common deployment methods for web projects based on python are: fcgi: Use spawn-fcgi or the tools that come with the framework to generate listening processes for each project, and then interact with the http service. wsgi: Use the mod_wsgi module of the http service to run each project. But there is also uwsgi, which neither uses the wsgi protocol nor the fcgi protocol. Instead, it creates its own uwsgi protocol. According to the author, this protocol is about 10 times as fast as the fcgi protocol. The main features of uwsgi are as follows: Ultra-fast performance. Low memory usage (measured to be about half of mod_wsgi of apache2). Multi-app management. Detailed log
    Nginx 1680 2023-05-17 20:52:04
  • How to solve nginx panic group problem
    How to solve nginx panic group problem
    1. Solution When each worker process is created, it will call the ngx_worker_process_init() method to initialize the current worker process. There is a very important step in this process, that is, each worker process will call the epoll_create() method to create a unique process for itself. Some epoll handles. For each port that needs to be monitored, there is a file descriptor corresponding to it, and the worker process only adds the file descriptor to the epoll handle of the current process through the epoll_ctl() method and listens to the accept event. Triggered by the client's connection establishment event to handle the event. from
    Nginx 1621 2023-05-17 20:49:14
  • How to implement Nginx request restriction and access control
    How to implement Nginx request restriction and access control
    1. Nginx request restrictions 1. HTTP protocol connection and request http protocol version and connection relationship http protocol version connection relationship http1.0tcp cannot reuse http1.1 sequential tcp multiplexing http2.0 multiplexing tcp multiplexing http The request is based on a tcp connection. A tcp connection can generate at least one http request. After http1.1 version, multiple http requests can be sent by establishing a tcp connection. 1. Connection frequency limit syntax syntax:limit_conn_zonekeyzone=name:size;default:—context:httpsyntax
    Nginx 1894 2023-05-17 20:37:04
  • How to monitor Nginx/Tomcat/MySQL with zabbix
    How to monitor Nginx/Tomcat/MySQL with zabbix
    Zabbix monitors nginxa machine: zabbix server (192.168.234.128) b machine: zabbix client (192.168.234.125) Operation on b machine (zabbix client): edit nginx virtual host configuration file: [root@centos~]#vi/ etc/nginx/conf.d/default.conf Add the following content in server{}: location/nginx_status{stub_statuson;access_logoff;allow127.0.0.1;denyall;}Reload ngi
    Nginx 1542 2023-05-17 20:31:04
  • What is Socket segmentation in Nginx server
    What is Socket segmentation in Nginx server
    The 1.9.1 release of nginx introduced a new feature: allowing the use of the so_reuseport socket option, which is available in new versions of many operating systems, including dragonflybsd and Linux (kernel version 3.9 and later). This socket option allows multiple sockets to listen on the same IP and port combination. The kernel is able to load balance incoming connections across these sockets. (For nginxplus customers, this feature will appear in version 7, which will be released by the end of the year) The so_reuseport option has many potential practical applications. Other services can also use it to simply implement rolling upgrades during execution (nginx already supports rolling upgrades). right
    Nginx 713 2023-05-17 20:19:10
  • Nginx configuration file example analysis
    Nginx configuration file example analysis
    Common functions of nginx 1. http proxy, reverse proxy: As one of the most commonly used functions of web servers, especially reverse proxy. Here I will give you two pictures to explain the positive agent and the reactive agent. You can read the information for the specific details. When nginx is used as a reverse proxy, it provides stable performance and can provide forwarding functions with flexible configuration. nginx can adopt different forwarding strategies based on different regular matching, such as going to the file server at the end of the image file, and going to the web server for dynamic pages. As long as you have no problem writing regular rules and have corresponding server solutions, you can do whatever you want. of play. And nginx performs error page jump, exception judgment, etc. on the returned results. If the distributed server stores
    Nginx 931 2023-05-17 19:25:04
  • How to quickly install Nginx server on CentOS 6.6
    How to quickly install Nginx server on CentOS 6.6
    1. Download nginx Download the latest version of nginx from the official website of nginx (http://nginx.org/en/download.html). Here I downloaded nginx-1.9.12. After the download is completed, you will get a compressed package as shown in the figure below. Upload the nginx tar package to the Linux server, as shown in the figure below: 2. Install nginx2.1. Installation prerequisites. Before installing nginx, you need to ensure that g++ and gcc are installed on the system. , openssl-devel, pcre-devel and zlib-devel software. 1. Install necessary software: yum-yinstallzli
    Nginx 1152 2023-05-17 19:18: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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!