Overview
From this blog post, will lead the reader to appreciate the strong nginx.
What is Nginx used for? I believe that many friends have already used, if you do not, then you must know one of the following names: Apache,lighttpd,tomcat,jetty. They occupy almost all of the current Web server, where Apache is the most well-known and the most heavyweight. LIGHTTPD, Tomcat, and Jetty are relatively lightweight, where Jetty, Tomcat is used as a Java server container.
Nginx is a bsd-like protocol based, open source, high performance, lightweight HTTP server, reverse proxy server, and e-mail (SMTP, POP3, IMAP) servers. Nginx was developed by a Russian software engineer named "Igor Sysoev", originally used for the rambler.ru website (the site is ranked second in Russian domestic traffic).
Don't bother with these backgrounds, here are two very brief Nginx location examples. If you have not touched the Nginx configuration file before, so now you see these two examples may be some doubts, no relationship, this intuitive understanding of the first left in your mind, and then the article will take you step-by-step into the world of Nginx.
Instance implementation
http://a.com/abc
To
http://b.com/abc
Add a piece of code to the Submodule server of the HTTP module in Nginx's default configuration file:
location ^~ /hd{ rewrite ^/hd/(.*)$ http://www.google.com/$1 permanent;}
Realize
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 many nginx configuration file syntax content, if temporarily do not understand, no relationship, don't worry, next you will soon learn.
Research on the configuration and deployment of high performance Web server Nginx (1) nginx introduction and Getting Started example