How can I use caddy to create a proxy

1. The problem I’m having:

Currently some requests I need to make are being blocked due to IP restrictions on GCP.

I’m trying to use a server outside of GCP as a proxy to send these requests.

I set up the server and have tried a few different forward proxy configs but have yet to succeed.

I ran into a few different suggestions and plugins but I’m not entirely sure which route is the way to go.

I believe the closest I got was returning the error: The remote server returned an error: (308) Permanent Redirect; It may have been due to not using a domain which I assume was lacking SSL at that point.

3. Caddy version:

v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=

4. How I installed and ran Caddy:

a. System environment:

Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-166-generic x86_64)

b. Command:

sudo systemctl start caddy

d. My complete Caddy config:

I am hoping for help on this.

Please completely fill out the help topic template, as per the forum rules. What’s your config? What’s in your logs?

I’m not sure how to answer this. As I mentioned, I had tried a number of configurations but I am getting mixed information as to what I need to do.

I’ve been suggested to build caddy with the forward plugin here caddyserver/forwardproxy: Forward proxy plugin for the Caddy web server (

However it seems like it hasn’t been receiving updates, and where it says “Read this blog post about how to configure your specific client” the link is broken. I noticed now that there is no further development taking place for V2 of this plugin.

It isn’t very clear to me if I need to rebuild Caddy with a plugin. I noticed the interactive builder didn’t have the plugin either.

I also read somewhere that reverse_proxy has somewhat negated the need for a forward proxy plugin but cannot remember where I read this.

Just now I found this: klzgrad/naiveproxy: Make a fortune quietly ( as well.

I guess I am wondering what the ideal route to take would be; If I should custom build it, and what my config should be if I don’t need a custom plugin for this behavior; So I am unable to provide those for you.

Sorry for the frustration. The original developer of the forwardproxy plugin moved onto other things a while ago, and it’s in the process of being ported to Caddy v2:

I imagine, as the community picks up the maintenance of the plugin, that functionality and documentation will improve.

In theory, it should work if you build from the branch of that PR – as long as you don’t rely on probe resistance, which it’s unclear to me if it’s currently working or not.

That’s a reverse proxy; forwardproxy is a forward proxy. They are subtly different resulting in significantly different behavior.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.