1. Caddy version (caddy version
):
v2.4.6
2. How I run Caddy:
systemd ( as a service) on ubunutu lxc
a. System environment:
Ubuntu 21.04 (GNU/Linux 5.11.22-7-pve x86_64)
b. Command:
curl 172.16.199.119:2020/config/apps/http/servers/srv0/routes/ \
-X POST \
-H "Content-Type: application/json" \
-d @- << EOF
{
"@id": "secured.server.ae",
"match": [
{
"host": [
"secured.server.ae"
]
}
],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "192.168.88.31:443"
}
]
}
]
}
EOF
c. Service/unit/compose file:
Dont know where to find this !
d. My complete Caddyfile or JSON config:
using API only to configure caddy
3. The problem I’m having:
I am having trouble proxying the host to my backend server that is running a webserver on port 443 (https).
And if I turn off HTTPS on the server and proxy to port 80 i don’t get the page to render correctly nor i can log in to the web app on that server but on my lan its working as it should on port 80.
4. Error messages and/or full log output:
I usually use https://192.168.88.31 to browse it on my lan , but after adding the above config via API i get " Too Many Redirects " if i enable HTTPS only on my server and proxy to port 80,
Or I get a 502 error if i redirect to port 443.
5. What I already tried:
I tried turning off HTTPS on my server and using plain port 80 and doing so I can reach my server but the page doesn’t render correctly and the login does not work, etc.
Then I tried turning on HTTPS again from my server and using port 443 with the server IP in my curl config but it gives 502 error.
Please Help me I have a lot of HTTP servers in LAN that need to be proxied via API!