backlitz 大佬有话说 : 2019-12-11 18:52:59
nginx反代CF
使用nginx反代cf上的站点,显示cloudflare 403,但是完全相同的配置,只修改host,却可以正常反代 share.dmhy.org 。请问下有没有大佬知道这是怎么回事。
auto8624 大佬有话说 : 2019-12-11 19:05:00
:lol帮你定下。。
sixpence 大佬有话说 : 2019-12-11 19:06:24
你这个属于套子上加套子了,肯定不行啊
cyclists 大佬有话说 : 2019-12-11 19:56:29
sixpence 大佬有话说 : 2019-12-11 19:06
你这个属于套子上加套子了,肯定不行啊
理论上是可以无限套的,楼主可以贴出配置瞅瞅
backlitz 大佬有话说 : 2019-12-11 20:34:26
cyclists 大佬有话说 : 2019-12-11 19:56
理论上是可以无限套的,楼主可以贴出配置瞅瞅
location / {
proxy_set_header Accept-Encoding "";
proxy_pass https://share.dmhy.org;
proxy_set_header Host share.dmhy.org;
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;
}
按照如上配置,可以正常反代使用CF的dmhy,但是我自己建的站就不可以。
陈道临 大佬有话说 : 2019-12-11 20:49:51
location / {
sub_filter_types *;
sub_filter nyaa.si nyaa.uk;
sub_filter_once off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Referer https://nyaa.si;
proxy_set_header Host nyaa.si;
proxy_pass https://nyaa.si;
proxy_set_header Accept-Encoding "";
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
# use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;
}
仅供参考
cyclists 大佬有话说 : 2019-12-12 13:22:05
backlitz 大佬有话说 : 2019-12-11 20:34
按照如上配置,可以正常反代使用CF的dmhy,但是我自己建的站就不可以。
注意添加 hosts 应该就没啥问题了,可以参考楼上的
cyclists 大佬有话说 : 2019-12-12 17:22:00
cyclists 大佬有话说 : 2019-12-12 13:22
注意添加 hosts 应该就没啥问题了,可以参考楼上的
跟楼主确认一下,反代 CF ,是不支持443的
burde 大佬有话说 : 2019-12-12 17:27:50
了解了。