Website access speed and enhancing website availability and security. DNS round robin and squid reverse proxy can be used to achieve Load Balancing for websites, thus improving the availability and reliability of websites.
The reverse proxy server is also called the Web Acceleration Server.It is located at the front end of the web server and serves as the content cache
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 {
of the PHP-FPM listener
Fastcgi_pass 127.0.0.1 This format when you specify a listener address
vim /data/wwwroot/test.com/example.phpWritecurl -x127.0.0.1:80 test.com/example.phpFour, nginx agentcd /usr/local/nginx/conf/vhostdig www.baidu.com //查找一个网站的ipIf the dig command does not existyum install -y curl -x127.0.0.1:80 www.baidu.com/robots.txtvim proxy.conf //加入如下内容server{ listen 80
:/tmp/php-fcgi.sock;Fastcgi_index index.php;Fastcgi_param Script_filename/data/wwwroot/test.com$fastcgi_script_name;}Fastcgi_pass used to specify the address or socket of the PHP-FPM listener[Email protected] ~]# vi/data/wwwroot/test.com/3,phpFour, nginx agentCd/usr/local/nginx/conf/vhostVim proxy.conf//Add the following:Server{Listen 80;server_name ask.apelearn.com;Location/{Proxy_pass http://121.201.9.155
Guide
Nginx is an open source high-performance HTTP server and reverse proxy server, while supporting the IMAP/POP3 Proxy service, is a free software, but also the operation and maintenance engineers will be a kind of server, the following I would simply say the installation of Nginx server and file resolution.
How to configure reverse proxy and Nginx reverse proxy for nginx
The network structure is as follows.You may only have one public IP address. however, your intranet has a website that needs to be mapped to the Internet. and do not want to add other non-80 ports. then you can directly use
Enable FASTCGI CachingEdit the virtual host configuration file that must be enabled for caching.
Nano/etc/nginx/sites-enabled/vhost
Add the following line to the top of the file beyond the server{} directive:
Fastcgi_cache_path/etc/nginx/cache levels=1:2 keys_zone=myapp:100m inactive=60m;
Fastcgi_cache_key "$scheme $request_method$host$
In Nginx, Proxy is used to implement the reverse proxy, upstream is used to achieve load balancing.For example, there are two servers, the Nginx server as a proxy server, execute. php files on the Apache server, the client sends the request to the
Static pages: pages written in static programming language are static pages, support static pages of the language, CSS HTML XML, do not manually change the source code, the page will not change.Dynamic pages: Pages written in dynamic programming languages are dynamic pages, the languages that support dynamic pages are, Java PHP. NET, which displays different pages depending on the time users visit and the different users.Nginx website Service AgentExperiment (i) experimental purpose:
Nginx Agent and load balancing configuration and optimization
Nginx Agent
Nginx, starting with version 0.7.48, supports the caching function similar to squid. The Nginx Web caching service consists of Proxy_cache related instruction set and Fastcgi_cache related instruction set, which is used to
, after one process exits, the other processes are still working, the service is not interrupted, and the master process restarts the new worker process quickly. Of course, the abnormal exit of the worker process must be a bug in the program, and an exception exit will cause all requests on the current worker to fail, but will not affect all requests, thus reducing the risk.
(6)
Small memory consumption: processing large concurrent request memory consumption is very smal
of the load balancing server; # When there is no index page, list Files and subdirectories # retain the Real user information proxy_redirect off; # Do not jump to proxy_set_header Host $ host; proxy_set_header X-Real-IP $ Remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; # initiate a handshake with the timeout value of the backend server and wait for the response timeout value # proxy_connect_timeout 12; # after the connection is successful, wait for the response time o
proxy server. In fact, the proxy server forwards the request and returns the results of others.
So what is the role of reverse proxy? According to the Encyclopedia:Provides encrypted connections from the external proxy server of the firewall to the Internal Security content server of the firewall. Allows clients to S
fact, the proxy server forwards the request and returns the results of others.
So what is the role of reverse proxy? According to the Encyclopedia:Provides encrypted connections from the external proxy server of the firewall to the Internal Security content server of the firewall. Allows clients to Securely connect to the pr
Squid + MRTG implement complete cache proxy and HTTP service acceleration proxy
By mirolers
Author: zitianxingTime: 2002-9-25Source: www.hackerabc.com
Squid is an open source code high-performance Proxy Cache Server. It supports proxy
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.