I am making progress with Caddy. This is a very interesting project.
I have this Caddyfile:
www.simplsites.com www.simplpages.com {
reverse_proxy * {
to 172.17.0.5:5000
header_up X-Real-IP {remote_host}
header_up X-Forwarded-Proto {scheme}
header_up Access-Control-Allow-Headers Cache-Control,Content-Type
transport http {
read_buffer 8192
}
}
}
That I need to port to JSON but very hard to see where some things go for the “reverse_proxy” section. I will update Wiki with more examples to help future people if I can get some help.
Questions:
- Where does the “to” go? This is obviously the most important question.
- Is it important to include the “*” so all traffic goes to backend server?
- Is the “read_buffer” important for a reverse proxy?
1. Caddy version (caddy version
):
v2.0.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
2. How I run Caddy:
caddy run
a. System environment:
Ubuntu 16
b. Command:
N/A
c. Service/unit/compose file:
N/A
d. My complete Caddyfile or JSON config:
www.simplsites.com www.simplpages.com {
reverse_proxy * {
to 172.17.0.5:5000
header_up X-Real-IP {remote_host}
header_up X-Forwarded-Proto {scheme}
header_up Access-Control-Allow-Headers Cache-Control,Content-Type
transport http {
read_buffer 8192
}
}
}
3. The problem I’m having:
I need to use JSON/API for configuring managing Caddy. Porting the reverse_proxy section of the above Caddy file to JSON is very difficult.
4. Error messages and/or full log output:
N/A
5. What I already tried:
This is my JSON file currently:
{
“admin”: {
“disabled”: false
},
“apps”: {
“http”: {
“servers”: {
“webase”: {
“listen”: [
“:443”
],
“routes”: [
{
“match”: [
{
“host”: [
“*.webase.com”, “www.simplsites.com”, “www.simplpages.com”
]
}
],
“handle”: [
{
“handler”: “reverse_proxy”,
“transport”: {
“protocol”: “http”
},
// is it important to include the "*" so all traffic goes to backend server?
// where does the "to" go?
// is the "read_buffer" important?
}
]
}
]
}
}
}
}
}
6. Links to relevant resources:
N/A