Tinyproxy反向代理“访问被拒绝”

red*_*ent 5 proxy reverse-proxy tinyproxy

我正在使用tinyproxy来反向代理。我有三个指向同一服务器的子域,我们需要它们在内部指向特定的端口。即,来自任何特定子域的端口80映射到特定端口。请参阅下面的配置示例。

配置看起来像这样:

Port 80
#Allow 127.0.0.1
#ReverseOnly yes
upstream 127.0.0.1:8115 "website.example.com"
upstream 127.0.0.1:3000 "api.example.com"
upstream 127.0.0.1:9000 "socket.example.com"
Run Code Online (Sandbox Code Playgroud)

当我拉起任何子域时,我得到的是:

拒绝访问
此代理的管理员尚未将其配置为服务来自主机的请求。
由tinyproxy版本1.8.3生成。


我在任何地方都找不到足够的文档。我正在考虑与维护者联系。请帮忙。

Sha*_*lan 2

我希望您已经得到答案,但如果您还没有,这里是允许客户端连接到您的代理的设置:

#
# Allow: Customization of authorization controls. If there are any
# access control keywords then the default action is to DENY. Otherwise,
# the default action is ALLOW.
#
# The order of the controls are important. All incoming connections are
# tested against the controls based on order.
#
Allow 127.0.0.1
#Allow 192.168.0.0/16
#Allow 172.16.0.0/12
#Allow 10.0.0.0/8
Allow 0.0.0.0/0
Run Code Online (Sandbox Code Playgroud)

在我的示例中,我允许0.0.0.0/0,因为我正在配置从 Internet 到其他 VPS 的反向代理。

另外,上面的配置适用于正向代理,而不是反向代理。

要启用反向代理功能,您至少需要满足以下条件:

ConnectPort 80
ConnectPort 443
ReversePath "/" "http://<your server IP>:8080/"
ReverseOnly Yes
ReverseMagic Yes
Run Code Online (Sandbox Code Playgroud)