I have a Tinyproxy Docker container forwarding traffic on a host. I also have Nginx reverse proxy receiving/passing HTTP/HTTPS connections to other servers on the same host. Tinyproxy and Nginx are on different Docker networks. Nginx and the servers behind it share the same Docker network. If I try to restrict Nginx's incoming connections to connections coming from Tinyproxy, everything works fine. I checked Nginx's logs and saw that all proxied connections were coming from Nginx's gateway, presumably because Docker was handling the routing between its networks. Then I just restricted incoming connections to the gateway on Nginx's server directives:

deny all;


When I close 80 and 443/tcp ports on my host, Tinyproxy cannot access the servers. My goal is to close 80 and 443/tcp ports and only allow incoming traffic through Tinyproxy to servers behind Nginx.

What I've Tried

Specified Nginx's and Tinyproxy's networks on my UFW rules (ufw allow from to port 80/tcp; ufw allow from to port 443/tcp, being Tinyproxy's network). No success.

  • nginx is a full reverse proxy, for what reason you want to use tiny proxy?
    – djdomi
    Mar 30, 2023 at 17:46
  • @djdomi I'm using Tinyproxy as a forward proxy to limit access to Nginx; one of the apps that are behind Nginx does not support public key for client TLS on auth, so the solution I found was this Mar 30, 2023 at 18:14
  • nginx can do basic auth for example
    – djdomi
    Mar 30, 2023 at 19:37
  • Yes, I just saw that Nginx can also act as a forward proxy... Well, it makes sense to me to have this host's reverse proxy (Nginx) and forward proxy (Tinyproxy) on different Docker networks, so that I can use different services/ports; what I cannot understand is why Tinyproxy's packets are blocked by UFW in this particular case Mar 30, 2023 at 19:58
  • Have you tried to put the 'allow' directive AFTER the 'deny all' directive ? Mar 31, 2023 at 15:16


You must log in to answer this question.

Browse other questions tagged .