Preface
Nginx is a high-performance HTTP server, which can be cached by proxy cache for static resources. The principle is that the static resources in accordance with certain rules of the local hard disk, and will be in memory to cache commonly used resources, so as to speed up the response of static resources. Confi
: This article mainly introduces nginx Reverse proxy, dynamic and static request separation, and nginx cache application, as well as using ngx_cache_purge to clear the specified URL. if you are interested in the PHP Tutorial, please refer to it. 1. nginx Reverse
Nginx Reverse Proxy Server Load balancer page cache URL rewriting and read/write splitting
Outline
I. Preface
II. Environment preparation
3. install and configure Nginx
Iv. reverse proxy for Nginx
5. Load Balancing for
Proxy_busy_buffers_size 128k; #增加系统繁忙时可申请的proxy_buffers大小Proxy_temp_file_write_size 128k; #增加proxy缓存临时文件的大小Proxy_next_upstream Error timeout Invalid_header http_500 http_503 http_404; #增加故障转移, if the back-end server returns 502, 504, execution timeout, and so on, automatically forwards the request to another server in the upstream load balancing pool to implement failover. Proxy_cache Cache_one; #增加使用web缓存区cache_one(eight), set the
Project Practice: 1-LNMP construction, nginx reverse proxy and cache implementation, lnmpnginx
Practice 1: build commercial websites such as lnmp and Xiaomi
Environment: Disable firewall, selinux
1. Install the package and enable the Service
Yum-y install nginx mariadb-server php-fpm php-mysql
Systemctl start
This article is an entry-level introduction to nginx, including installation, basic usage, Server Load balancer, dynamic/static separation, reverse proxy, and cache applications.
Dependency preparationYou can download the dependent libraries from the official website as follows:PCREHttp://www.pcre.org/
ZlibHttp://zlib.netHttp://sourceforge.net/projects/libpng/f
Tags: NGINX proxy rewrite cacheShare the next Nginx+rewrite+proxy+cache todayThe difference between Nginx and Apache1.nginx based on IP restrictionsSmall experiment:worker_processes 1;
Here give an example, and detailed.
HTTP {[...][...]Proxy_cache_path/data/nginx/cache/one levels=1:2 keys_zone=one:10m max_size=10g;Proxy_cache_key "$host $request_uri";server {server_name www.centos.bz centos.bz;Root/home/www.centos.bz/web;Index index.php index.html index.htm;Location/{Proxy_pass http://127.0.0.1:8080;Proxy_set_header Host "Www.centos.bz";Proxy_set_header x-forwarded-for $
Yesterday tried to build the NuGet image server with Nginx, the mirror server requires two functions: 1) reverse proxy; 2) content cache.Using Nginx as the reverse proxy, the configuration is very simple, just add a server setting with Proxy_pass in/etc/nginx/nginx.conf:serv
: This article mainly introduces nginx anti-Leech + dynamic/static separation + reverse proxy + cache + server load balancer. if you are interested in PHP tutorials, refer to it. Modify nginx/conf/nginx. conf as follows:
User www; worker_processes 1; # error_log logs/error.
;???????? #连接memcacheMemcached_connect_timeout time;???????????????? #连接超时时间Memcached_read_timeout 5s;???????????????????? #nginx服务器向mc发出两次写请求之间的等待时间, if no data is transferred during that time, the connection will be closedMemcached_read_timeout 5s;???????? #两次读请求之间Memcached_buffer_size 32k;???????????? #nginx接收mc数据的缓冲区大小?Here we use a picture to do the test>>> f = open ("/root/p.jpg")>>> F=f.read ()>>> mc
Using squid as a directional proxy server can function like Nginx, and can store cached content in memory, Nginx cache content on a hard disk, and configure the same principle as nginx, squid himself works as a Web server, Direction prox
Nginx is a good tool for processing static content. although Apache occupies more memory and has a poor performance, it has been relatively stable. However, Nginx FastCGI may sometimes encounter a 502BadGateway error. An optional method is to use Nginx as a front-end proxy to process static content and forward dynamic
Node development phase, generally used
httpModule to start a local server, easy to debug.
It's probably like this:
varrequire("http");var server = http.createServer();server.listen(8888);
So the question is, how do I deploy my application to the VPS? You can't use it http://10.88.77.66:8888 to access it? Yes, the title of the article is the solution.
My environment is roughly the same centos 6 lnmp一键部署 . As lnmp for how to operate, I will not write. Google for yourself
Suppose my domain name is
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.