Nginx-rewrite regular expression matching
Case matching
~ to match case sensitivity~* for case-insensitive matching!~ and!~* are case insensitive and case-insensitive mismatches, respectively.
File and directory matching
-F and!-f are used to determine whether a file exists-D and!-d used to determine whether a directory exists-E and!-e used to determine whether a file or directory exists-X and!-x are us
Nginx is generally recommended to install to a Linux system, and to install the C language compilation environment GCC
* Download Nginx
Enter http://nginx.org/en/download.html download Nginx (take 1.8 for example)
* install Nginx-dependent packages First:
1, the installation of
Blocking call: The event is not ready, it will only wait, wait until the event is ready, you can continue.Blocking calls into the kernel waits, the CPU will let go out to others, for the single-threaded workers, obviously inappropriate, when the network event more time, everyone is waiting, CPU idle No one use, CPU utilization naturally not go, not to talk about high concurrency.Asynchronous non-blocking: asynchronous, non-blocking event handling mechanism, specifically to system calls such as S
Introduction: Nginx rewrite rewrite rules and anti-theft chain configuration method, rewrite rule format flag tags in several forms, hotlinking return 403 error, allow the domain name directly following the second row of the domain name.
Nginx
Nginx
Nginx is a high-performance HTTP and reverse proxy server, also a IMAP/POP3/SMTP server.
To support the response of up to 5w concurrent connections, Nginx chooses epoll/kqueue as the network IO model.
Nginx can also be used as a Load balancer server, nginx written in C
Mode one: Nginx cronolog log partition configuration document, according to the following method, split the Nginx access log every minute.1. nginx Log configuration access_log access_log/data/access_log_pipe main;2. Create a named pipe first mkfifo/www/Log/access_log_pipe3. Configuration Cronolog:nohup Cat/data/access_log_pipe |/usr/local/sbin/cronolog/data/Log/d
Configuration items for debugging and locating problems
Whether to run Nginx in daemon mode
Syntax: Daemon On|offDefault: Daemon onRole: Daemons are processes that can be detached from the terminal and run in the background. He was removed from the process to avoid the information in the process of printing at the terminal, so that the process will not be interrupted by any information generated by the terminal. By default, the daemon is turned on.Ho
Nginx Rewrite Rules, nginxrewrite Rewrite
The main function of Rewrite is to rewrite the URL. The Rewrite function of Nginx is to use the global variables provided by
For example, I have a file storage server, bandwidth always keep up with the situation. The server can be configured with some configuration to reduce the bandwidth pressure. The cost savings are relative to the company. Look for the Nginx configuration for bandwidth operations.
Nginx provides limit_rate and limit_rate_after Details Query Nginx configuration
Error 1:
nginx: [Emerg] mkdir () "/var/tmp/nginx/client/" failed (2:no such file or directory)
[Root@localhost nginx-1.6.2]# Nginxnginx: [Emerg] mkdir () "/var/tmp/nginx/client/" failed (2:no such file or directory) Problems that do not exist or permissions below we create [root@localhost
Nginx default log is unified write to the installation directory under the log, access log is Access.log, error log is Error.log
And does not provide a configurable place, for the production environment, the log is concentrated together, not a few days log files can be large to a few grams, can only use the operating system of the scheduled task, their own script timed execution, the log log to be cut.
Refer to the article on the online predecessors,
Modify PHP configuration file
Parameter setting descriptionvi php.ini file_uploads on #是否允许通过HTTP上传文件的开关。默认为ON即是开 upload_tmp_dir – #文件上传至服务器上存储临时文件的地方,如果没指定就会用系统默认的临时文件夹 upload_max_filesize 8m #允许上传文件大小的最大值。默认为2M post_max_size 8m #通过表单POST给PHP的所能接收的最大值,包括表单里的所有值。默认为8M DescriptionGenerally speaking, after setting up the above four parameters, it is not a problem to upload However, if you want to upload a large file of >8m, it is not necessarily possible to set the above four items. Unless your
Nginx worker Process Number
Syntax: worker_processes number;Default: Worker_processes 1;Role: Defines the number of worker processes in the Master_worker run mode. The number of worker processes directly affects performance. So, how many fits? Based on business requirements. Each worker is a single-threaded process, and his demons invoke each module to implement a variety of functions. If you determine that these modules do not have plug-in calls, th
IntroducedPeople often encounter such demand, an active page URL address is very long, promote product operation and user feedback is not easy to rememberNot beautiful, but temporarily no way to modify the code, this time can be used to rewrite. Or you now have a website upgrade to HTTPS now some users are still accessing HTTP you want to unify HTTPS, which can be implemented with rewrite rules.Rewrite over
I have written two articles in front of the introduction of Nginx_http_limit_req_module and Nginx_http_limit_conn_module, respectively, the number of user requests and the number of connections to limit, and the white list is mainly to some internal personnel division, and thus unaffected by limitations.
Take a look at the previous article:Nginx Limit number of requestshttp://blog.csdn.net/wanglei_storage/article/details/51076882Nginx Limit number of connectionshttp://blog.csdn.net/wanglei_stor
The first few days of using the public platform, the developer tool can be configured callback address, some events through the address back to the developer. The URL needs to be authenticated the first time it is configured. Simply send a string of strings to the server specified by the URL, and then the server must return a string of strings, that is, echostr.
I'm going to use Nginx,ng to go back to Tomcat, so I'm just going to return the echost
Hello.
This should be a problem when Uwsgi gets the kernel release version of your system during installation.
In the program uwsgiconfig.py
uwsgi_os_k = re.split('[-+]', os.uname()[2])[0]
If the system kernel release version is ' 2.6.32_1-12-0-0 ', the program gets uwsgi_os_k = ' 2.6.32_1 ',K_minor = ' 32_1 ' After processing iteration, error in int (k_minor) >= 25 o'clock because K_minor = ' 32_1 ' translates the Digital times wrong.
Modify:You can modify the uwsgiconfig.py file in the U
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.