current location:Home > Technical Articles > Operation and Maintenance > Nginx
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Daily Programming WeChat Applet Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- 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
- Nginx 2423 2023-05-18 13:19:14
-
- 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
- Nginx 1708 2023-05-18 12:25:06
-
- 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
- Nginx 2228 2023-05-18 12:07:35
-
- 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
- Nginx 1785 2023-05-18 12:07:06
-
- 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
- Nginx 848 2023-05-18 12:01:06
-
- 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
- Nginx 2716 2023-05-18 11:29:01
-
- 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
- Nginx 1216 2023-05-18 10:28:12
-
- 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~
- Nginx 1368 2023-05-18 10:10:34
-
- 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
- Nginx 2109 2023-05-18 09:04:13
-
- How to configure and use proxy protocol in nginx
- When proxyprotocol is used in nginx, we know that nginx is a web server and proxy server. It generally works behind proxyserver or load balancing software (Haproxy, Amazon Elastic LoadBalancer (ELB)). The client first requests proxyserver or LSB load balancing software, and then to nginx Perform real web access. Because it has gone through multiple layers of software, some client information such as IP address, port number, etc. may be hidden, which is detrimental to our problem analysis and data statistics. Because for nginx, We want to be able to get real clients
- Nginx 3074 2023-05-18 08:47:26
-
- How to solve the problems encountered when installing vsftpd in nginx
- The simplest installation steps [root@itdragon~]#useraddftpuser[root@itdragon~]#passwdftpuserchangingpasswordforuserftpuser.newpassword:badpassword:itistooshortbadpassword:istoosimpleretypenewpassword:passwd:allauthenticationtokensupdatedsuccessfully.[root@itdragon~]#yum-yi
- Nginx 789 2023-05-18 08:40:05
-
- How to use Nginx to deal with cross-domain issues in the Vue 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
- Nginx 1767 2023-05-18 08:28:05
-
- How to configure Nginx to prohibit access to a certain directory or file
- Copy the code as follows: location=/config/{return404;} location=/config.ini{return404;} This will only prohibit access to //www.jb51.net/path/ Copy the code as follows: location=/path/{ return404;} Access to //www.jb51.net/path/test.php is prohibited. Copy the code as follows: location^~/test{denyall;} Maybe test should be replaced with path.
- Nginx 2986 2023-05-18 08:04:15
-
- Nginx installation and configuration example analysis
- nginx is a free, open source, high-performance http server and reverse proxy server; it is also an imap, pop3, and smtp proxy server; nginx can be used as an http server for website publishing and processing, and nginx can be used as a reverse proxy server. The proxy implements load balancing. Here we briefly introduce nginx reverse proxy load balancing nginx features from three aspects: 1. Reverse proxy About proxy Speaking of proxy, first we have to clarify a concept, the so-called proxy is a representative and a channel; at this time, we design two Roles, one is the agent role and the other is the target role. The process in which the agent role accesses the target role to complete some tasks through this agent is called agency.
- Nginx 1038 2023-05-17 23:28:04
-
- How to set WordPress pseudo-static in Nginx
- First, configure the server module in nginx as follows: location/{if(-f$request_filename/index.html){rewrite(.*)$1/index.htmlbreak;}if(-f$request_filename/index.php) {rewrite(.*)$1/index.php;}if(!-f$request_filename){rewrite(.*)/index.php;}}After the configuration is completed, restart nginx and then go to the "Settings" in the WordPress blog background --"fixed
- Nginx 2295 2023-05-17 23:25:04