proxysu / ProxySU

Xray,V2ray,Trojan,NaiveProxy, Trojan-Go, ShadowsocksR(SSR),Shadowsocks-libev及相关插件,MTProto+TLS 一键安装工具,windows下用(一键科学上网)
GNU General Public License v3.0
5.48k stars 1.52k forks source link

VLESS-H2C-Caddy2 中 caddy2 配置文件 如何设置反代一个正常网站 #8

Closed ghost closed 4 years ago

ghost commented 4 years ago

参考至https://github.com/v2fly/v2ray-examples/tree/master/VLESS-H2C-Caddy2 v2ray client <--- H2 ---> caddy2 <--- H2C ---> v2ray server

caddy2 配置文件内容

test.myweb.club {

reverse_proxy https://lovelive-as-global.com

reverse_proxy /374c71672ced/ 127.0.0.1:22157 { transport http { versions h2c } } }

我想要访问我的域名,内容是反代 https://lovelive-as-global.com 这个网站。

加了 reverse_proxy https://lovelive-as-global.com 后 v2ray无法正常工作,访问我的域名也打不开要代理的网站。

删除 reverse_proxy https://lovelive-as-global.com 后 v2ray正常工作。

proxysu commented 4 years ago

是的,这个问题我也发现了,我想可能使用Caddy v2的话需要使用json配置格式的文件,这只是一个猜想,等我有时间好好去研究一下,Caddy v2的json配置。

ghost commented 4 years ago

是的,这个问题我也发现了,我想可能使用Caddy v2的话需要使用json配置格式的文件,这只是一个猜想,等我有时间好好去研究一下,Caddy v2的json配置。

我关闭的原因是,当时过了一会我发现可以正常反代我设置的网站同时v2ray也是正常的。 这是我的caddy 配置和v2ray服务器端配置。所以当时我正常后我就关闭了这个。没想到你回复了。


我的域名 {

reverse_proxy https://lovelive-as.bushimo.jp

reverse_proxy /374c71672ced/ 127.0.0.1:22157 {
    transport http {
        versions h2c
    }
}

}

{ "log": { "loglevel": "warning" }, "inbounds": [ { "port": 22157, "protocol": "vless", "settings": { "clients": [ { "id": "我的ID", "level": 0 } ], "decryption": "none" }, "streamSettings": { "network": "h2", "security": "none", "httpSettings": { "path": "/我的路径/", "host": [ "我的域名" ] } } } ], "outbounds": [ { "protocol": "freedom" } ] }