virtual machine 192.168.101.3 insteadConfiguration of the virtual host:
to modify the/usr/local/nginx/conf/nginx.conf file, add two virtual hosts as follows:# Configure virtual host aaa.test.comserver {# Listen for IP and ports, configure native IP and PortsListen 192.168.101.3:80;# The
be set to ON,#如果用来进行下载等应用磁盘IO重负载应用, can be set to OFF,#以平衡磁盘与网络I/O processing speed, reducing the uptime of the system.#tcp_nopush on;Keepalive_timeout 120; #连接超时时间Tcp_nodelay on;server {Listen 80;server_name localhost;Access_log Logs/access.log;Error_log Logs/error.log;CharSet Utf-8;Location/{Index index.html index.htm;root HTML;}Error_page 502 503 504/50x.html;Location =/50x.html {root HTML;}}}
Second, the
content in the local cache and sends the content directly to the user;
4) if there is no information requested by the user in the local cache, the reverse proxy server will request the same information from the source server and send the information to the user, if the information is cached, it will be saved to the cache.
4. Benefits of reverse
Nginx in front, I wrote several, similar introduction rotten it on each platform installation configuration and PHP-FPM connection and so on. Today, this article focuses on its configuration, including the balance of liabilities and reverse proxies it excels at, as well as the virtual hosting capabilities. Nginx Startup and shutdown
According to the Convention, the configuration of each platform is described first:
CentOS platform, source installed:
/
Virtual Web Host:Build LNMP ServiceInstallationNginxMARIADB, Mariadb-server, Mariadb-develPHP, PHP-FPM, Php-mysqlStart Nginx, MariaDB, FPM service;and test whether the LNMP is working properly.Build two Web services with different domain namesProxy Server:Build Nginx Service#vim/usr/local/nginx/conf/nginx.conf......HTTP {Server_tokens off;Client_header_buffer_size 1k;Large_client_header_buffers 4 4k;Include
Add a virtual host# vim/usr/local/nginx-1.9.0/conf/vhost/proxy.confserver { 8.8. 8.8; 8088 ; / { proxy_pass http://$http _host$request_uri; } }Nginx to implement the agent online, there are three key points must be noted that the rest of the configuration as normal Nginx1. Add DNS resolution resolver2. Add server w
Cache_mgr webmaster@scetc.net
# Run squid as squid
Cache_inclutive_user squid
Cache_paitive_group squid
# Proxy server name
Visible_hostname nat.scetc.net
# Set transparent proxy
Httpd_accel_host virtual
Httpd_accel_port 80
Httpd_accel_with_proxy on
Httpd_accel_uses_host_header on
# Average cache target size
Store_avg
client's original request and the original response of the target server to meet the requirements of the proxy protocol. Proxy server options and settings in a computer program, usually including a "firewall", which allows the user to enter proxy addresses, which will obscu
The purpose of the standalone mode setting is to allow the agent to manage one of its own servers.
Administrators can authorize a proxy directly as a standalone mode in the admin zone-agent management.
Proxy Landing Agent area, you can in the proxy area, the independent mode of management, add their own name of the server
: LoadModule proxy_http_modulemodules/mod_proxy_http.soB. Configure the agent:In fact, the configuration of the virtual host file (I:\xampp\apache\conf\extra\httpd-vhosts.conf), there is a default host is localhost, we look at its default configuration: ServerAdmin [email protected] documentroot "/xampp/htdocs/" errorlog "Logs/dummy-host2.example.com-error.log" customlog "Logs/dummy-host2.example.com-access.log" commonThe above is the default 1
access the background web server.
2. Implement load balancing and redundant backup for the backend web server group through Nginx Reverse Proxy Server
Preparations:
1. Independently deploy the web (www1.rsyslog.org) server on Apache and implement access (Brief Introduction)
httpd.confcd/usr/local/apache2/conf/ls. /modules/saw that there was mod_prxoy.so.Edit Config file vi httpd.conf modify the following loading moduleLoadModule proxy_module modules/mod_proxy.so (This is generated when compilation is activated)LoadModule proxy_http_module modules/mod_ Proxy.so (this sentence is to be added manually)Part of the virtual host PlusNamevirtualhost *: the the>ServerAdmin [email protected]-host.example.comServerName www.a.orgP
in the address bar with the server name: inproxy.sjtu.edu.cn and port: 8000.Enter your account and password as prompted. (When setting proxy, note that if you access the Internet through dialing, you must set proxy in the dialing setting of Internet Options; if you access the Internet through broadband, you need to set a pro
configuration fileVI httpd.confModify the followingLoading modulesLoadModule Proxy_module modules/mod_proxy.so (this is generated when compilation is Activated)LoadModule proxy_http_module modules/mod_proxy.so (this sentence is to be added manually)Part of the virtual host PlusNamevirtualhost *:80ServerAdmin [email protected]ServerName www.a.orgProxyrequests OFFOrder Deny,allowAllow from allproxypass/http://192.168.0.115/proxypassreverse/http://192.1
access many educational resources on CERNET, therefore, put the default egress line on CERNET and use a valid IP address. The default egress lines in the other two regions are placed on CHINANET, and the ISP usually does not provide a valid IP address to the school, therefore, we generally use two NICs on such a Cache, one using the Intranet virtual address and the other using the virtual address provided
Web server by adding a high-speed web buffer server between the busy Web server and the Internet, increasing the speed of access to Web pages. The reverse proxy server is located between the user Web server and the Internet. When
name to the backend VPs, as long as the domain name to the front-end VPS, the backend VPS for domain binding, then you can directly access the One nginx with multiple domain names multiple tomcat scenarios configuration Multiple domain names, 2 of which need to support pan domain name resolution: 1, www.abc.com 2, www.bcd.com 3, *.efg.com 4, *.hij.com One of the two tomcat,4 is a standalone tomcat. Front-end one nginx, by configuring multiple virtual
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
file: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;Client_max_body_size 50 m; // maximum number of bytes allowed for client requests per fileClient_body_buffer_size 256 k; // maximum number of bytes requested by the buffer proxy to buffer the clientProxy_connect_timeout 30; // timeout value for connecting to the backend serverProxy_send_timeout 30;
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.