Research on the configuration and deployment of high-performance WEB server nginx (1) nginx introduction and getting started example
- Author: poechant
- Blog: blog.csdn.net/poechant
- Email: zhongchao. USTC # gmail.com (#-> @)
- Date: August 29Th, 2011
- Update: February 26Th>, 2012.
Overview
Starting from this blog, we will show readers the strength of nginx.
What is nginx used? I believe many of my friends have already used it. If you do not have one, you must know one of the following names: Apache, Lighttpd, tomcat, and jetty. They occupy almost all of the current Web servers, of which Apache is the most well-known and heavyweight. Lighttpd, tomcat, and jetty are relatively lightweight. jetty and tomcat are mostly used as Java Server containers.
Nginx is a BSD-like protocol, open-source, high-performance, lightweight HTTP server, reverse proxy server, and email (SMTP, POP3, IMAP) server. Nginx was developed by a software engineer named "Igor Sysoev" in Russia and was originally used for rambler.ru websites (the site ranks second in traffic in Russia ).
The following describes two very brief nginx location examples. If you have never touched the nginx configuration file before, you may have some questions about the two examples. It doesn't matter. This intuitive understanding stays in your mind first, later articles will show you step by step into the nginx world.
Instance implementation
http://a.com/abc
To
http://b.com/abc
Add a piece of code to the sub-module server of the HTTP module in the default nginx configuration file:
location ^~ /hd{ rewrite ^/hd/(.*)$ http://www.google.com/$1 permanent;}
Implementation
http://a.com/msg?url=www.b.com
To
http://www.b.com
location ^~ /img_proxy{ set $img_proxy_url ""; set $suffix ""; if ($query_string ~ "url=(.*)") { set $img_proxy_url $1; set $suffix ""; } resolver 208.67.222.222; proxy_pass http://$img_proxy_url/$suffix; proxy_set_header referer "http://$img_proxy_url";}
The above two examples have a lot of syntax content for the nginx configuration file. If you do not understand it for the moment, it doesn't matter. Don't worry. You will learn it soon.
-
For more nginx technical blog posts, visit the csdn column nginx High-Performance Web Server
For more information, see "LIU Da's csdn blog": blog.csdn.net/poechant
-