onsy 大佬有话说 : 2019-12-17 13:31:07
宝塔怎么不能反代,弄好400?
问题来了,有较好用的教程吗?可以做CDN,镜像站之用。
Dami 大佬有话说 : 2019-12-17 13:37:57
#PROXY-START/
location /wp-admin
{
expires 12h;
if ($request_uri ~* "(php|jsp|cgi|asp|aspx)")
{
expires 0;
}
proxy_pass https://www.xxx.com;
proxy_pass_header Set-Cookie;
proxy_set_header Host www.xxx.com;
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;
#持久化连接相关配置
proxy_connect_timeout 30s;
proxy_read_timeout 86400s;
proxy_send_timeout 30s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
add_header x-cache $upstream_cache_status;
#Set Nginx Cache
proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 301 302 1440m;
}
location /
{
expires 12h;
if ($request_uri ~* "(php|jsp|cgi|asp|aspx|/wp-admin.*)")
{
expires 0;
}
proxy_pass https://www.xxx.com;
proxy_pass_header Set-Cookie;
proxy_set_header Host www.xxx.com;
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;
proxy_ignore_headers Cache-Control Expires Vary;
#持久化连接相关配置
proxy_connect_timeout 30s;
proxy_read_timeout 86400s;
proxy_send_timeout 30s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
add_header x-cache $upstream_cache_status;
#Set Nginx Cache
proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 301 302 1440m;
}
#PROXY-END/
coobar 大佬有话说 : 2019-12-17 14:15:23
Dami 大佬有话说 : 2019-12-17 13:37
https://www.hostloc.com/thread-624483-1-1.html
大佬看下这个怎么破
onsy 大佬有话说 : 2019-12-17 14:43:57
Dami 大佬有话说 : 2019-12-17 13:37
谢谢,回家试试