Redirect all Traffic that isn't Already redirected to a Certain IP

1. Caddy version (caddy version):

Right now, I’m running v2.5.1.

a. System environment:

I’m on Ubuntu 22.04.

Currently, my config file looks like this.

gitea.stanleyshen.com{
        tls internal
        reverse_proxy 192.168.1.5:80
}

How do I redirect all traffic that isn’t already redirected to an IP to another server?
For example psuedo code:

if (not redirected already):
    forward to ip

You’ll need a space there: gitea.stanleyshen.com {

What do you mean by “redirected to an IP to another server” and “forward to IP”? Like an HTTP 3xx redirect? Why would any connection destined for another IP arrive at your server anyways? You’ll need to be more specific. I’m sad that you deleted the help template :frowning:

1 Like