


How to solve the error 'Welcome to nginx on Fedora!' after installing nginx on 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 18, 2023 pm 04:34 PM
How to set directory whitelist and ip whitelist in nginx
1. Set the directory whitelist: There is no restriction on the specified request path. If there is no restriction on the request path to the api directory, it can be written as server{location/app{proxy_passhttp://192.168.1.111:8095/app ;limit_connconn20;limit_rate500k;limit_reqzone=fooburst=5nodelay;}location/app/api{proxy_passhttp://192.168.1.111:8095/app/api}}#Because nginx will give priority to accurate matching
May 18, 2023 pm 03:52 PM
Nginx brief installation and configuration example analysis
1. Files required for nginx installation 1), nginx-1.2.8.tar.gz2), openssl-1.0.1g.tar.gz3), pcre-8.31.tar.gz4), zlib-1.2.7.tar.gz The download address of the above installation package is normally available. Since I am using the above version of the installation package, the following installations are based on this. 2. Configuration environment of linux machine 2.1, java environment $java-versionjavaversion"1.8.0_45"java(tm)seruntimeenvironment(build1.8.0_
May 18, 2023 pm 03:34 PM
How to configure nginx read-write separation
Reading and writing separation of nginx 1. Analysis of experimental topology requirements, one nginx at the front end as a load balancing reverse proxy, and two httpd servers at the back. The entire architecture is to provide bbs (forum) services. There is a need to achieve separation of reading and writing, which is the function of uploading attachments. The attachments we upload can only be uploaded to web1, and then rsync+inotify is used to synchronize attachments on web1. Everyone knows rsync. +inotify can only synchronize from master to slave, not bidirectional synchronization. Therefore, web1 can perform write operations, while web2 can only perform read operations, which brings about the need for separation of reading and writing. Let's talk about how to achieve separation of reading and writing. 2.webdav function descriptionwebdav(w
May 18, 2023 pm 03:19 PM
How to check the compilation parameters of nginx, apache, mysql, php under Linux
Quickly check the compilation parameters of the server software: 1. nginx compilation parameters: your_nginx_dir/sbin/nginx-v2, apache compilation parameters: catyour_apache_dir/build/config.nice3, php compilation parameters: your_php_dir/bin/php-i|grepconfigure4, mysql compilation Parameters: catyour_mysql_dir/bin/mysqlbug|grepconfigure The following is a complete practical example: View and obtain nginx compilation parameters: Copy the code The code is as follows: [root@www~
May 18, 2023 pm 02:16 PM
How to configure nginx to return text or json
Let's first look at returning fixed text and json. You can configure location interception in the server. The configuration example is as follows: Fixed text: location~^/get_text{default_typetext/html;return200'thisitext!';} Fixed json:location~^ /get_json{default_typeapplication/json;return200'{"status":"success",&q
May 18, 2023 pm 01:19 PM
How to configure location and rewrite rules in Nginx
Location tutorial example: location=/{#Exact match/, the host name cannot be followed by any string [configurationA]}location/{#Because all addresses begin with /, this rule will match all requests#But regular and the longest string will be matched first [configurationB]}location/documents/{#Match any address starting with /documents/. After matching, continue to search downwards#Only when the subsequent regular expression is not matched, This article will use [configurationC]}location~/document
May 18, 2023 pm 12:25 PM
How to implement Nginx current limiting
How does nginx current limiting work? Nginx current limiting uses the leaky bucket algorithm (leakybucket algorithm), which is widely used in communications and packet switching-based computer networks to handle emergencies when bandwidth is limited. The principle is very similar to a bucket with water entering from above and leaking from below; if the rate of water inflow is greater than the rate of water leakage, the bucket will overflow. In the request processing process, the water represents the request from the client, and the bucket represents a queue in which the request is waiting to be processed according to the first-in-first-out (fifo) algorithm. A leak means a request leaves the buffer and is processed by the server, an overflow means a request is dropped and never served. 1. Limit access frequency (normal traffic) ngi
May 18, 2023 pm 12:07 PM
How to intercept uri in nginx location
Note: The root and aliasroot instructions in location only set the search root to the directory set by root, that is, the uri will not be truncated. Instead, the original uri will be used to jump to the directory to find the file. The aias instruction will truncate the matching uri, and then Use the path set by alias plus the remaining uri as a sub-path to find the uri of proxy_pass in location. If the url of proxy_pass does not have uri, if the tail is "/", the matching uri will be truncated. If the tail is not "/", then Will not truncate the matching uri if the proxy_pass url contains uri
May 18, 2023 pm 12:07 PM
How to configure basic memory pool initialization in Nginx
Initialization of ngx_cycle During the entire initialization process, the most important thing is the initialization of the global variable nginx_cycle. Many variables are initialized during this process. nginx_cycle is initialized through two local variables init_cycle and cycle. In fact, log initialization can also be regarded as Initialization of nginx_cyle, because what happens next in the code is an assignment ngx_memzero(&init_cycle,sizeof(ngx_cycle_t));init_cycle.log=log;ngx_cycle=&init_cycl
May 18, 2023 pm 12:01 PM
How to configure nginx server multi-site
1. First, find the location of the nginx configuration file. The nginx.conf file on Alibaba Cloud is in /alidata/server/nginx-1.4.4/conf. 2. Then create a vhosts directory in the conf directory. This directory is used to store the configuration files of different sites. 3. Then, add a line include/alidata/server/nginx/conf/vhosts/*.conf;userwwwwww;worker_processes1;error_log/alidata/log/nginx/error at the end of nginx.conf
May 18, 2023 am 11:29 AM
How to solve 403 caused by Nginx website root directory change
1. Change the root directory. The default website root directory of nginx is /usr/local/nginx/html. To change it to /home/fuxiao/www, change the method: vi/usr/local/nginx/conf/nginx.conf. Change location/{roothtml;indexindex.phpindex.htmlindex.htm;} to location/{root/home/fuxiao/www;indexindex.phpindex.htmlindex.htm;} and then change location~\.php${ro
May 18, 2023 am 10:28 AM
How to configure Nginx to divert traffic based on the last segment of the request IP
Mainly the configuration jump of the if judgment in the location parameter, offloading can reduce the load and pressure of the server. This is a very common server deployment architecture. Jump according to the range of the last segment of ip #Please modify the domain name, ip, port and other information yourself upstreamhuaji-01.com{server192.168.1.100:8080;}upstreamhuaji-02.com{server192.168.1.200:8080;} server{listen80;server_namewww.huaji.com;location/{if($remote_addr~
May 18, 2023 am 10:10 AM
How to customize exclusive 404 page in Nginx
The first: Nginx's own error page Nginx accesses a static html page. When this page does not exist, Nginx throws 404. So how to return 404 to the client? Look at the configuration below. In this case, there is no need to modify any parameters to achieve this function. server{listen80;server_namewww.test.com;root/var/www/test;indexindex.htmlindex.htm;location/{}#Define the error page code. If the corresponding error page code appears, forward it there. error_page404403500502503
May 18, 2023 am 09:04 AM
Hot tools Tags

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article
What's New in Windows 11 KB5054979 & How to Fix Update Issues
How to fix KB5055523 fails to install in Windows 11?
How to fix KB5055518 fails to install in Windows 10?
Strength Levels for Every Enemy & Monster in R.E.P.O.
Blue Prince: How To Get To The Basement

Hot Tools

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 phpstudy integrated installation environment runtime library

PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version
Chinese version, very easy to use
