1. Assume that you have 2 VPSs, one is Linode Japan, IP 1.1.1.1 (slow domestic direct access speed), and the other is Hong Kong CN2, IP 2.2.2.2 (fast domestic access speed) The website is built on Linode Japan VPS and the domain name is xxxxx.com. Install Baota Panel on Hong Kong CN2 VPS and install Nginx. 2. At your website's domain name resolution, set the domain name A record to the IP address of Hong Kong CN2 VPS: 2.2.2.2 3. Set up the Hong Kong CN2 VPS Pagoda panel page: Create a new website xxxxx.com, SSL certificate, set the reverse proxy to xxxxx.com, and enable cache Modify the /etc/hosts file and add the following information at the end of the file: 1.1.1.1 xxxxx.com 4. The default file cache location is /www/server/nginx/proxy_cache_dir The anti-proxy configuration file is /www/server/nginx/conf/proxy.conf 5. In this way, when others visit your website, they will use the speed of Hong Kong CN2, which is much faster than directly accessing Linode Japan. It is recommended that the reverse generation be performed on areas with similar locations. In addition, there can be multiple front-end nodes with the same settings. This article mainly refers to: https://www.openos.org/post/107/ 6. Baota panel uses Nginx to reverse Cloudflare CDN settings Use the same settings as above, and then modify the website configuration file and replace it with the following code: (mainly the content of #PROXY-START —— #PROXY-END) a. Use your own domain name to reverse the domain name in Cloudflare for acceleration (replace your domain name in it) #PROXY-START/ location ~* \.(php|jsp|cgi|asp|aspx)$ { proxy_pass https://your domain name; proxy_set_header Host your domain name; #Pass the visitor IP to the backend proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; #Pass the visitor IP to the backend proxy_ssl_name your domain name; proxy_ssl_server_name on; } location / { proxy_pass https://your domain name; proxy_set_header Host your domain name; #Pass the visitor IP to the backend proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; #Pass the visitor IP to the backend proxy_ssl_name your domain name; proxy_ssl_server_name on; #Cache settings add_header X-Cache $upstream_cache_status; #Set Nginx Cache proxy_ignore_headers Set-Cookie Cache-Control expires; proxy_cache cache_one; proxy_cache_key $host$uri$is_args$args; proxy_cache_valid 200 304 301 302 120m; expires 12h; } #PROXY-END/ b. Use your own domain name to represent someone else's domain name on Cloudflare #PROXY-START/ location ~* \.(php|jsp|cgi|asp|aspx)$ { proxy_pass https://the other party's domain name; proxy_set_header Host the other party's domain name; #Pass the visitor IP to the backend proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; #Pass the visitor IP to the backend proxy_ssl_name is the domain name of the other party; proxy_ssl_server_name on; } location / { proxy_pass https://the other party's domain name; proxy_set_header Host the other party's domain name; #Pass the visitor IP to the backend proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; #Pass the visitor IP to the backend proxy_ssl_name is the domain name of the other party; proxy_ssl_server_name on; #Cache settings add_header X-Cache $upstream_cache_status; #Set Nginx Cache proxy_ignore_headers Set-Cookie Cache-Control expires; proxy_cache cache_one; proxy_cache_key $host$uri$is_args$args; proxy_cache_valid 200 304 301 302 120m; expires 12h; } #PROXY-END/ Reposted from: https://hostloc.com/thread-643951-5-1.html |
Latest offer: $3.88 per month, details at http://...
Details : Aoyouhost: KVM VPS in CN2, Japan Softba...
MegaZoneHosting is a new merchant that mainly pro...
Linode, a super stable merchant, is the first cho...
1. Edit /etc/network/interfaces This file describ...
FormoHost, a Chinese host, provides VPS and dedic...
Tencent Cloud, the latest discounts, some product...
CrazyDomain is a relatively stable merchant, and ...
Uovz, a Chinese hosting provider that has been in...
SupremeVPS, newly established, mainly provides Lo...
HOSTMSU, a Chinese merchant, mainly provides KVM ...
Eoreality, the full name of End of Reality, is a ...
ApeWeb, a foreign merchant, mainly provides virtu...
Please note that according to the reminder of TG ...
Central.so seems to have been established not lon...