important file, the user may be dissatisfied.5. Nginx is not only an excellent Load Balancer/reverse proxy software, but also a powerful Web application server. LNMP is also a very popular web architecture in recent years. It is also stable in high-traffic environments.6. Nginx is now becoming more and more mature as the Web reverse acceleration cache, which is faster than the traditional Squid server. you
Next year will look for a job, look at the classic Open source project-nginx, the Library borrowed a The first is the Nginx environment configuration relatedReference post: Nginx Module development---Linux using Eclipse compilation, debugging Nginx article 5:linux using Eclipse for
greatly reduced after the test. The returned request is more stable.2) reduce backend resource consumption. It turns out that the backend is busy when data is returned due to factors such as slow client network, occupying resources. Through NGINX proxy to the backend, the backend can return quickly due to the NGINX Cache mechanism, and more resources are used to process requests, so that the backend capabi
been installed--with-http_stub_status_module: Used to monitor the current state of Nginx--with-http_realip_module: This module allows us to change the client IP address value (for example, X-real-ip or x-forwarded-for) in the client request header, meaning it allows the background server to record the original client's IP address--add-module=path: Add third-party external modules, such as
FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ {root /usr/share/nginx/html; Include Fastcgi_params; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param Script_filename/usr/share/nginx/html$fastcgi_script_name; # include Fastcgi_params; } # Deny access to. htaccess files, if Apache ' s document Root # concurs with
Install Nginx-echo module in Nginx
Nginx-echo can be used to output some information in Nginx. It is a good tool for testing troubleshooting. It can also make a summary of the information from different link addresses. In short, it can help developers. Next let's take a look at how to install and use it.
1. Download
manual, in order to facilitate the coding of Lookup C library functions, please yum install man-pages.
The configuration process includes Linux kernel parameter optimization (/etc/sysctl.conf), Nginx source configuration (can be directly downloaded, decompressed, configure, make, makes install), Nginx.conf's configuration, according to the original book is, nginx.conf's specific practice is left below. But you can take the original book to learn the
Through Nginx reverse proxy, will not get the real IP, is to obtain the Nginx IP, to get the real IP to be configured nginx configuration file: nginx.conf
Proxy_set_header X-real-ip $remote _addr;
For example:
######################################################################## #要转发地域名: Upstream t.csdn.com { server 192.168.1.188:8080 max_fails=0 weig
In the field of Linux background server development, Epoll's name is early to hear. "In-depth understanding of Nginx" in the 9th chapter-the event module details how Epoll related system calls are embedded in the Nginx framework.Below is a description of some of the modules in the Nginx framework related to event handl
stable in high-traffic environments.6. nginx is now becoming more and more mature as the Web reverse acceleration cache, which is faster than the traditional squid server. You can consider using nginx as the reverse proxy accelerator.7. nginx can be used as a middle-layer reverse proxy. nginx basically has no rivals o
client to start a new game (this refers to a "maintained" connection ). If the connection is closed (the client is disconnected or times out), the web server process returns and listens to a new game ".
The most important thing to remember is that a dedicated process or thread (a chess player) is required for the HTTP Connection of each activity ). This structure is simple and easy to expand third-party modules ("New Rules "). However, there is stil
value equals active– (reading + writing), meaning that the nginx has been processed and is waiting for the next request to host the connection.Note that this module is not compiled into Nginx by default, and if you want to use the module, specify when compiling the installation Nginx:
./configure–with-http_stub_status_module
To see if the install
-nginx-module/tags.Download Srcache-nginx-module in Https://github.com/openresty/srcache-nginx-module/tags.Download Lua-upstream-nginx-module in Https://github.com/openresty/lua-upstream-nginx-module/tags.
Download http://nginx.org/en/download.html, because some
1, Nginx relative to the advantages of Apache: Lightweight, same Web service that consumes less memory and resources than Apacheanti-concurrency, Nginx processing requests are asynchronous and non-blocking, while Apache is blocking , Nginx can maintain low consumption and high performance under high concurrent conditionshighly modular design, relatively simple to
[Nginx] Simple Nginx virtual host configuration and nginx Virtual Host Configuration
Bytes -------------------------------------------------------------------------------------------------------
Configure the VM:
1. Bind a domain name
Vim/etc/hosts # Add a format such as 192.168.1.11 www. chenwei. ws
2. Add a VM
Cd to the root directory, run vhost. sh to add the
1
)
server_name
directives are primarily used to configure name-based virtual hosts (
inside the http > server
),
server_name
The order in which the instructions are received after the request is:
1 . accuracy of server_name matches, for example:
server {
Listen 80;
Server_namessdr.infowww.ssdr.info;
...
}
2 . in * string starting with the wildcard character:
server {
Listen 80;
Server_name*.ssdr.info;
...
}
3 . in * A string that ends with a wildcard character:
server {
Listen 80;
server_name
install the PCRE library intothe system, or build the PCRE libraryStatically from the source with Nginx byusing--with-pcre=missing pcre-devel packageSolve:Centos :yum installpcre-devel can be solvedUbuntu:sduo Apt-get Pcre-devel can not find pcre-devel package , Debian/ubuntu system under the name changed, the name is libpcre3 Libpcre3-dev the Correct command is as follows:sudoapt-get Install libpcre3 Libpcre3-dev Continue compiling nginxError:./CON
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.