Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tinyproxy Reverse Proxy "Access denied"

I'm using tinyproxy to reverse proxy. I have three subdomains pointed to the same server, and we need them to point to specific ports internally. That is, port 80 from any particular subdomain, mapped to a particular port. See the config example below.

The config looks like this:

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"

When I pull up any subdomain, all I get is:

Access denied
The administrator of this proxy has not configured it to service requests from your host.
Generated by tinyproxy version 1.8.3.


I cannot find adequate documentation anywhere. I'm thinking of contacting the maintainers. Please help.

like image 411
redolent Avatar asked Nov 07 '22 22:11

redolent


1 Answers

I hope you already got the answer, but if you have not, here is the setting to allow client connecting to your proxy:

#
# 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

In my example here, I allow 0.0.0.0/0 because I'm configuring a reverse proxy from the Internet to my other VPS.

Also, your configuration above is for forward proxy, not reverse proxy.

To enable reverse proxy function, you need at least the following:

ConnectPort 80
ConnectPort 443
ReversePath "/" "http://<your server IP>:8080/"
ReverseOnly Yes
ReverseMagic Yes
like image 152
Sharuzzaman Ahmat Raslan Avatar answered Dec 06 '22 03:12

Sharuzzaman Ahmat Raslan