Squid reverse proxy cdn build configuration
Because of the business needs of the company, you need to build a cdn node somewhere by yourself. You can build a node by using DNSpod smart resolution and squid combination.
Installation path:/usr/local/squid
1. Install squid
Download http://www.squid-cache.org/Versions/v3/3.4/squid-3.4.8.tar.gz
# Yum-y install gcc-c
Author: ytfeiDate: 18:28:26Original article. For more information, see the source! Http://blog.romebuilder.com/2011/01/273/
There are many related articles on the Internet about the concept of reverse proxy. This is an article in Baidu: http://baike.baidu.com/view/1165595.htm.
Jetty can communicate with httpd through HTTP or AJP. jetty officially recommends using HTTP for communication. The following are je
long as the right side place can, the most important is the following line, according to fill on it! One station, one station to a port, the port do not repeat, otherwise your IIS inside the station will not start!
server {Listen server_name 1.jb51.net; location/{Proxy_pass http://208.28.188.249:81;}}
server {Listen server_name 2.jb51.net; location/{Proxy_pass http://208.28.188.249:82;}}
}
This is the proxy server
Server {Listen80; server_name the domain name corresponding to the Ngin server; Error_log/data/logs/nginx/Mainsite.error.log; Access_log/data/logs/nginx/Mainsite.access.log Main; #error_log logs/Error.log Notice; #error_log logs/Error.log Info; Location^~/api/{//"/api/" under the forward request path//set up cross-domainAdd_header Access-control-allow-origin *; Add_header Access-control-allow-credentialstrue; Add_header Access-control-allow-headers "Origin, No-cache, X-requested-with, If-modi
But the hands of the school has a few domain name resolution of the server (but it should be with VMware to do VPs, and so on, and then the relevant domain name to be resolved to have extranet IP reverse proxy server, and then through the reverse proxy Server squid distributed to the intranet)So one day whim, through t
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 proxy to the backend Web server to the user.
1. Install SquidTAR-ZXVF squid-3.4.10.tar.gzCD squid-3.4.10./configure--prefix=/usr/local/squid \--enable-gnuregex \--ENABLE-ICMP \
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 $proxy _add_x_forwarded_for;#开启反向代理缓存 and use the cache with z
This is the function that Nginx originally provided.
Application Scenarios
I only have one VPShave multiple domain names80 for external servicePredecessor condition
Use different ports to start different HTTP services.
Except 80 for Nginx.
Configure Nginx
sudo vim/etc/nginx/nginx.confAdd or fix to
server {Listen 80;server_name www.111cn.net;Location/{Proxy_pass http://127.0.0.1:8000;}}This way from the www.111cn.net, it will reverse
too troublesome.Openresty
Nginx Configuration
Create a new Vhost and configure the following
server {
server_name ivr.com; access_log/home/work/log/nginx/ Access.ivr.log; Error_log/home/work/log/nginx/error.ivr.log;
Proxy_set_header Host $http _host;Proxy_set_header x-forwarded-port $server _port;Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;Proxy_set_header X-forwarded-prot
servers on the Internet, instead of accessing a fixed server for requests from multiple clients on the Internet, the common Web Proxy server does not support external access requests to the internal network. When a proxy server can proxy hosts on the external network and access the internal network, this proxy service
to install MySQL[root@localhost ~]# yum–y Install Mysql-server
Note: This site relies on MySQL, using yum to install MySQL
[root@localhost ~]# yum–y Install Mysql-server
Install Javacenter
Creating databases and user names
[Root@localhost ~]# MySQLmysql> CREATE DATABASE Jcenter;Mysql> GRANT all on jcenter.* to ' jcenter ' @ ' localhost ' identified by ' Chris ';
After installing the configuration, you can go to
The concept of a forward proxyThe forward agent, the legendary agent, works like a springboard,To put it simply,I am a user, I cannot access a website, but I can access a proxy serverThis proxy server, he can access the site that I can't accessSo I first connected to the proxy server and told him that I needed the content that I could not access the siteProxy ser
, uncertain servers instead of accessing a fixed server for requests from multiple clients on the Internet. Therefore, the normal Web proxy server does not support external access requests to the internal network. When a proxy server is able to proxy hosts on an external network, this proxy service is called a
multiple clients on the Internet. Therefore, the normal Web proxy server does not support external access requests to the internal network. When a proxy server is able to proxy hosts on an external network, this proxy service is called a reverse
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
A reverse proxy (Reverse proxy) means that a proxy server accepts external connection requests and then forwards the request to a server on the internal network and returns the results obtained from the server to the external request-connected client. At this point, the
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.