查看: 33|回复: 3

宝塔怎么不能反代,弄好400?

[复制链接]

32

主题

169

回帖

536

积分

高级会员

积分
536
发表于 2019-12-17 13:31:07 | 显示全部楼层 |阅读模式
问题来了,有较好用的教程吗?可以做CDN,镜像站之用。
回复

使用道具 举报

12

主题

518

回帖

1134

积分

金牌会员

积分
1134
发表于 2019-12-17 13:37:57 | 显示全部楼层
[ol]
  • #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/[/ol]复制代码
  • 回复

    使用道具 举报

    106

    主题

    1077

    回帖

    2618

    积分

    金牌会员

    积分
    2618
    发表于 2019-12-17 14:15:23 | 显示全部楼层

    Dami 发表于 2019-12-17 13:37


    https://www.52.ht/thread-624483-1-1.html

    大佬看下这个怎么破
    回复

    使用道具 举报

    32

    主题

    169

    回帖

    536

    积分

    高级会员

    积分
    536
     楼主| 发表于 2019-12-17 13:37:00 | 显示全部楼层

    Dami 发表于 2019-12-17 13:37

    谢谢,回家试试
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关注公众号

    相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

    Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

    在本版发帖
    关注公众号
    返回顶部