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 Nginx
Vi. N
One, Nginx reverse proxy configuration
#tomcat Java code upstream tomcat_server{server 127.0.0.1:8080; } erver{listen 80; server_name www.wolfdream.com; Location/{proxy_redirect off; Proxy_set_header Host $host; Proxy_set_header X-real-ip $remote _addr; Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for; Proxy_pass Http://tomcat_server; }
It is obvious that the user accesses the www.wolfdream.com (you need to set the local localhost and
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 nginx
Sy
I studied the error messages in the nginx cache for two days.After I modified the configuration file, I still reported an error.Location ~ /Purge (/.*){Allow 127.0.0.1;Allow 192.168.0.0/24;Deny all;Proxy_cache_purge cache_one $ host $1 $ is_args $ args;}
Nginx: [emerg] unknown directive "proxy_cache_purge" in/home/data/websrv/
Original address:http://nginx.com/resources/admin-guide/caching/Nginx Content CacheThis chapter describes how to enable and configure caching responses received from proxied servers. When caching are enabled NGINX saves responses in the cache on the disk and uses them to respond to clients without Proxyin G The requests.This chapter discusses how to turn on and c
Based on the company's needs and future visits, nginx is used as the Server Load balancer server and cache Server. The backend uses two tomcat servers to provide web services, and user information data is stored in oracle, audio files are stored on a separate application server. The following is the configuration of nginx and tomcat. For oracle installation and c
:,Proxy_busy_buffers_size 8k;Proxy_max_temp_file_size 2048m;Proxy_temp_file_write_size 32k;Proxy_pass http://example.com;Configure the Proxy service cache to reduce response timeAlthough Buffering helps to free back-end servers to handle more requests, Nginx also provides a way to cache the content from the back-end server, without having to connect to upstream f
When Nginx is a reverse proxy, it can cache the response from upstream to local and construct the response message directly from the local client when the same content is requested by subsequent clients.Nginx Cache Data Structure:Shared memory : Store key and cache object metadatadisk space : storing data
Usag
proxy_buffer_size directives.An example:,Proxy_busy_buffers_size 8k;Proxy_max_temp_file_size 2048m;Proxy_temp_file_write_size 32k;Proxy_pass http://example.com;Configure the Proxy service cache to reduce response timeAlthough Buffering helps to free back-end servers to handle more requests, Nginx also provides a way to cache the content from the back-end server,
The core principle of high concurrent Web site architecture In fact, "all the user access requests are as far as possible forward", that is: can slow the existence of user computer Local, do not let him visit the CDN. Can cache CDN Server, do not let CDN to access the source (static server). If you can access a static server, do not access the dynamic server. And so on: Without access to the database and storage must not access the database and storag
: This article mainly introduces the nginx cache system design principles. if you are interested in the PHP Tutorial, please refer to it. Here, we use the nginx cache system as a clue to discuss the design and related details of a cache server. I try my best to analyze it fr
First, the agent mode
Proxy mode, where the specified content is cached when using Nginx reverse proxy, and the module used is Proxy_cache. Many of the tutorials on the web say that this pattern must be used in a reverse proxy, as if it could not be used in a single server. In fact, we use a little trick, will Nginx this machine's 80-port agent forward to the local 8080-port can be disguised to open the re
Recently, I want to use nginx's proxy_cache to cache some pages of a website. One nginx is used as a proxy and two web servers. The web site is a PHP pseudo static page, during the test, we found that nginx could not cache pseudo-static html at the backend, and static html could! Is it because I have misconfigured
Nginx itself has a cache function, can cache static objects, than slices,CSS,JS and other content directly cached to local, the next time access to the same object, directly from the cache, no need to access the backend static server and storage storage server, can replace squid function. 1Environment Preparation We're
[Original article link: http://blog.s135.com/nginx_cache/]Nginx versions 0.7.48 and later support cache functions similar to squid. This cache uses the URL and related combinations as the key and stores them on the hard disk after MD5 hash. Therefore, it supports any URL link, it also supports non-404/301 status codes such as 302/200. Although the official
With the Nginx Web server getting more and more favor of SA, Nginx cache function already has the Web caching acceleration function that squid owns, and clears the function of specifying URL cache. In the performance, Nginx on the use of multi-core CPU, more than a lot of sq
; proxy_cache_valid 200 12 h; # set different cache times for different HTTP status codes # combine domain names, Uris, and parameters into the Web cache Key values. Nginx Hashing Based on the Key values, store the cached content to proxy_cache_key in the second-level cache directory. $ Host $ uri $ is_args $ args; pro
open source Web application server, which belongs to the lightweight application server and is the server for developing and debugging JSP programs.On Server2 and Server3 virtual machines:Tomcat Installation :SH jdk-6u26-linux-x64.binMV jdk1.6.0_26//usr/localVim/etc/profileExport JAVA_HOME=/USR/LOCAL/JDKExport classpath=: $JAVA _home/libExport path= $PATH: $JAVA _home/binSource/etc/profileLn-s/usr/local/jdk1.6.0_26/javaTar zxf apache-tomcat-7.0.37.tar.gz-c/usr/localLn-s/usr/local/apache-tomcat-
Recently want to use Nginx Proxy_cache cache some pages of the site, a nginx to do proxy, two Web,web station is a pseudo-static PHP page, test found Nginx can not cache the backend for pseudo-static HTML, static HTML can! Is it me where the configuration is wrong, or
Use the srcache_nginx module in Nginx to build the cache
In nginx, lua can be embedded, so that nginx can execute lua scripts to handle high concurrency and non-blocking requests. In openresty, you can use nginx to directly build srcache_nginx + redis caches, instead of usin
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.