Reverse proxy quick-start
This guide will show you how to get a production-ready reverse proxy up and running quickly.
- Basic terminal / command line skills
caddyin your PATH
- A running backend process to proxy to
There are two easy ways to get a quick reverse proxy up and running. We'll show you two equivalent ways to do the same thing.
This tutorial assumes you have a backend HTTP service running on
In your terminal, run this command:
caddy reverse-proxy --to 127.0.0.1:9000
If you don't have permission to bind to low ports, you can proxy from a higher port:
caddy reverse-proxy --from :2016 --to 127.0.0.1:9000
Then make a request to localhost (or whatever address you specified in
--from) to see it working!
In the current working directory, create a file called
Caddyfile with these contents:
localhost reverse_proxy 127.0.0.1:9000
Then, from the same directory, run:
You can then make a request to https://localhost to see it working!
It's easy to change the proxy's address:
:2016 reverse_proxy 127.0.0.1:9000
Make sure to reload Caddy (or stop and start it again) when you change the Caddyfile.
Now you can access the proxy at localhost:2016.
There is a lot more you can do with the