bzero
(bzero)
March 6, 2021, 11:16pm
1
1. Caddy version (caddy version
):
v2.3
2. How I run Caddy:
systemctl start caddy
a. System environment:
Debian 10
b. Command:
caddy reload
c. Service/unit/compose file:
paste full file contents here
d. My complete Caddyfile or JSON config:
tomcat.domain.com {
rewrite / /app-backend
reverse_proxy 192.168.0.70:8080 {
}
}
3. The problem I’m having:
i unable to browse domain https://tomcat.domain.com , cause the backend url including “/app-backend”.
The full backend URL is http://192.168.0.70:8080/app-backend/
That’s why i have to use rewrite for now, but it shows “/app-backend”. I want to browse https://tomcat.domain.com/ only.
How could i make it works?
Thank you.
You need to use *
as your matcher, not /
. Path matching in Caddy v2 is exact, so /
means to only match exactly /
and nothing else. Try this:
tomcat.domain.com {
rewrite * /app-backend{uri}
reverse_proxy 192.168.0.70:8080
}
If that doesn’t work, then your backend triggers redirects or serves responses with /app-backend
in links and asset paths, then this approach won’t work, and you’ll need to make changes in your backend to accept requests at a different base path, without /app-backend
.
bzero
(bzero)
March 7, 2021, 3:18am
3
Thanks @francislavoie for quick reply.
I tried as your recommend but it doesn’t work, it shows me “too many redirects”.
I guess this could be the case you mentioned, i don’t know how to make it to use without /app-backend
Axelor is backend app i am using.
[et_pb_section fb_built=”1″ _builder_version=”4.10.5″ background_color=”#0a2540″ background_color_gradient_direction=”284deg” background_image=”https://axelor.com/wp-content/uploads/2021/08/ecrans_axelor.png” background_size=”initial”...
Est. reading time: 26 minutes
system
(system)
Closed
April 5, 2021, 11:17pm
4
This topic was automatically closed after 30 days. New replies are no longer allowed.