Article Tags
How to install Nginx using YUM under CentOS7 system

How to install Nginx using YUM under CentOS7 system

Introduction nginx was developed by igorsysoev for Russia's second most visited rambler.ru site. The first public version 0.1.0 was released on October 4, 2004. It releases its source code under a BSD-like license and is known for its stability, rich feature set, sample configuration files, and low system resource consumption. The steps in the centos7 conditional tutorial require root user privileges. 1. Add nginx to the yum source. Add the centos7nginxyum resource library, open the terminal, and use the following command: sudorpm-uvhhttp://nginx.org/packages/centos/7/noarch/r

May 21, 2023 am 08:40 AM
nginx centos7 yum
How to configure and optimize FastCGI in Nginx

How to configure and optimize FastCGI in Nginx

fastcgi: fastcgi is developed and improved from cgi. The main disadvantage of the traditional cgi interface method is poor performance, because every time the http server encounters a dynamic program, the script parser needs to be restarted to perform parsing, and then the results are returned to the http server. This is almost unavailable when dealing with high concurrent access. In addition, the traditional cgi interface method has poor security and is rarely used now. The fastcgi interface mode adopts the c/s structure, which can separate the http server and the script parsing server, and start one or more script parsing daemons on the script parsing server. Every time the http server encounters a dynamic program, it can be delivered directly to fastcg

May 21, 2023 am 08:16 AM
nginx FastCGI
How to solve nginx+php-fpm service HTTP status code 502

How to solve nginx+php-fpm service HTTP status code 502

For one of our web projects, due to the increase in new cities, the number of visits has increased and the pressure on the db has increased. As a business party that provides interfaces, a large number of "502" requests have been reported recently by downstream feedback. 502, badgateway, is usually an error in upstream (here is PHP). For PHP, the common cause of 502 is that the script execution exceeds the timeout setting time, or the timeout setting is too large, resulting in the PHP process not being released for a long time, and there are no idle workers. process to pick up guests. Our project is caused by the PHP execution time setting being too short. In this case, you can first increase the PHP execution time appropriately and ensure that 502 is cleared first. Optimization will cost more after all.

May 21, 2023 am 08:07 AM
PHP nginx fpm
nginx load balancing instance analysis

nginx load balancing instance analysis

Note on load balancing of nginx. As you can see, since our website is in the early stages of development, nginx only acts as an agent for one back-end server. However, as our website’s reputation has grown and more and more people are visiting, one server cannot handle it. , so we added multiple servers. How do we configure proxies for so many servers? Here we take two servers as an example to demonstrate for everyone. 1. Upstream load balancing module description case: The following sets the load balancing server list. upstreamtest.net{ip_hash;server192.168.10.13:80;server192.168.10.14:80down;server192.1

May 21, 2023 am 08:01 AM
nginx
How to customize PHP's $_SERVER variable in nginx

How to customize PHP's $_SERVER variable in nginx

1. First, add the variable values ​​you want to add in the nginx configuration. The file content is as follows: location~\.php${try_files$uri=404;root/data/www.shuchengxian.com/;fastcgi_pass127.0.0.1 :9000;fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;fastcgi_paramENVIRONMENT'DEV&a

May 20, 2023 pm 11:52 PM
PHP nginx $_server
How to set up a high-performance WEB server with Linux+Nginx+Php

How to set up a high-performance WEB server with Linux+Nginx+Php

nginx ("enginex") is a high-performance http and reverse proxy server, as well as an imap/pop3/smtp proxy server. nginx was developed by igorsysoev for Russia's second most visited rambler.ru site, where it has been running for more than two and a half years. igor releases the source code under a BSD-like license. Although still in beta, nginx is already known for its stability, rich feature set, sample configuration files, and low system resource consumption. Installation step 1. Compile and install the support library tarzxvflibiconv-1.13.t required for php5.2.9

May 20, 2023 pm 11:19 PM
Linux PHP nginx
How to use nginx and docker to implement a simple load balancing

How to use nginx and docker to implement a simple load balancing

Test steps: 1. Build an nginx server in the server and start it. 2. Pull the official image of nginx from the source in docker, dockerpullnginx, and keep it for later use. 3. Create two new folders in the local directory. I created them here. /mydata/test1, /mydata/test2/4. Create new index.html in the two test folders to mark them. Output thisisnginx1 in the first html, and output thisisnginx2 in the second html. 5. Run through docker Containers of two nginx servers and map the static directories to the directories we just created

May 20, 2023 pm 10:01 PM
Docker nginx
How to set up nginx+php server application under Linux system

How to set up nginx+php server application under Linux system

It is similar to installing other software. The installation process is basically a fool-proof installation of nginx. Execute the following command and it will be completed quickly sudoapt-getinstallnginx. The default installation location of the configuration file: conf:/etc/nginx/nginx.confbin:/usr/sbin/ nginxvhost:/etc/nginx/sites-enable/defaultcgi-params:/etc/nginx/fastcgi-params Install the php-cgi module sudoapt-getinstallphp5-cgi The default installation location of the configuration file

May 20, 2023 pm 07:55 PM
Linux PHP nginx
How Nginx reverse proxy implements session persistence

How Nginx reverse proxy implements session persistence

1. ip_hash: ip_hash uses the source address hash algorithm to always send requests from the same client to the same back-end server unless the server is unavailable. ip_hash syntax: upstreambackend{ip_hash;serverbackend1.example.com;serverbackend2.example.com;serverbackend3.example.comdown;serverbackend4.example.com;}ip_hash is simple and easy to use, but has the following problems: when the backend server goes down, session will be lost; from the same

May 20, 2023 pm 07:25 PM
nginx
How to solve the problem 'Welcome to nginx on Fedora!' after installing nginx in Centos7

How to solve the problem 'Welcome to nginx on Fedora!' after installing nginx in Centos7

Problem description: When installing nginxsudoyuminstallnginx on Tencent Cloud centos7, open the default webpage and display welcometonginxonfedora! And there is no default.conf file in the /etc/nginx/conf.d directory. Reason: Tencent Cloud’s epel source is downloaded by default, which is fedora. Solution • Preparation sudoyuminstallyum- utils • Create nginx.repo file sudovim /etc/yum.repos.d/nginx.repo and add the following content [nginx-stable] name=nginxstab

May 20, 2023 pm 06:22 PM
nginx centos7
How to solve the problem that the port is occupied when opening Nginx

How to solve the problem that the port is occupied when opening Nginx

As shown in the figure: Check the port occupancy: sudonetstat-apn|grep80 Check the process occupying the port: ps-ef|grep3345 From the results, we can see that port 80 is occupied by nginx itself. You can kill the process and restart nginxsudokill-93345sudonetstat-apn |After grep80 successfully kills the process, start nginx. Start nginx successfully. Enter the IP address of the system where nginx is located in the browser to verify whether nginx starts successfully. The following introduces the startup, stop and restart of nginx. The startup code format: nginx installation directory address - cnginx configuration file address for example: [

May 20, 2023 pm 05:46 PM
nginx
How to use Nginx to handle Vue's development environment

How to use Nginx to handle Vue's development environment

1. The local test domain name needs to be the same as the online domain name in order to correctly deliver cookies and perform SSO testing. Note: Since the relevant cookies are added to the fourth-level domain name after sso login, the local test domain name and the online interface domain name need to be the same. 2. The plan is to configure the host file so that the online domain name points to localhost: 127.0.0.1product.xxx.xxx.com and configure nginx for corresponding forwarding: server{listen80;listen[::]:80;server_name${product.xxx.xxx. com};location/api{proxy_passhtt

May 20, 2023 pm 05:16 PM
VUE nginx
How to configure a reverse proxy using Nginx

How to configure a reverse proxy using Nginx

General configuration Under normal circumstances, friends who are familiar with nginx know that if you need to configure a reverse proxy, just write a location context and proxy module. If you need to customize the prefix, use a rewrite module. A simple example is as follows: location~/dfs/group([0-9]){proxy_passhttp://localhost:8080;rewrite^/dfs/(.*)$/$1break;proxy_set_headerhost$host:$server_port;proxy_set_headerx-real -ip$re

May 20, 2023 pm 04:28 PM
nginx
How to speed up nginx performance

How to speed up nginx performance

Turn on gzip configuration #Turn on gzipgzipon;#The minimum file to enable gzip compression, files smaller than the set value will not be compressed gzip_min_length1k;#gzip compression level, 1-10, the larger the number, the better the compression, and the more CPU time will be taken up, later There will be detailed descriptions of gzip_comp_level2;# file types for compression. JavaScript comes in many forms. The values ​​can be found in the mime.types file. gzip_typestext/plainapplication/javascriptapplication/x-javascripttext/c

May 20, 2023 pm 03:25 PM
nginx

Hot tools Tags

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use