1. Output of caddy version
:
v2.6.2
2. How I run Caddy:
sudo caddy start
a. System environment:
Debian 11
b. Command:
Paste command here.
c. Service/unit/compose file:
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane. -->
d. My complete Caddy config:
Paste your config here, replacing this text.
Use `caddy fmt` to make it readable.
DO NOT REDACT anything except credentials.
LEAVE DOMAIN NAMES INTACT.
Make sure the backticks stay on their own lines.
3. The problem I’m having:
I am trying to reverse proxy from a subdomain to an application running on a certain port.
In the past I had my applications running on docker and everything was fine. But docker regularly rewrites IP_tables and I want to have control over my firewall rules, since I am using a VPS, where every exposed port is directly exposed to the internet.
Unfortunately the reverse proxy to localhost is not working with ufw blocking anything incoming except 80 and 443. I always get a ‘connection refused’ error, unless I expose the port I am forwarding to.
How do I best configure Caddy to avoid exposing ports?
4. Error messages and/or full log output:
Paste logs/commands/output here.
USE THE PREVIEW PANE TO MAKE SURE IT LOOKS NICELY FORMATTED.