rainyu
(余雨)
April 10, 2022, 7:33am
1
I have a vue+java project. When the front-end accesses the back-end interface, I can’t access the 404. This project is normal on nginx. After migrating to caddy, there is a problem. I hope you can guide me to configure the front and rear cross sections. domain problem.Below is my existing configuration.
http://localhost:2100 {
encode zstd gzip
root * /home/dist
file_server browse
reverse_proxy /api/* http://192.168.1.6:8000 {
header_up Host {http.reverse_proxy.upstream.hostport}
header_down Access-Control-Allow-Headers *
header_down Access-Control-Allow-Origin *
}
}
Please fill out the help topic template. We can’t help unless you fill it out and provide more detailed information.
rainyu
(余雨)
April 11, 2022, 1:41am
3
1. Caddy version (caddy version
):
Caddy v2
2. How I run Caddy:
In virtual machine with Ubuntu20.04
a. System environment:
Ubuntu20.04
b. Command:
caddy adapt --config /path/Caddyfile
caddy run
c. Service/unit/compose file:
systemd
d. My complete Caddyfile or JSON config:
http://localhost:2100 {
encode zstd gzip
root * /home/dist
file_server browse
reverse_proxy /api/* http://192.168.1.6:8000 {
header_up Host {http.reverse_proxy.upstream.hostport}
header_down Access-Control-Allow-Headers *
header_down Access-Control-Allow-Origin *
}
}
3. The problem I’m having:
Always 404 when my frontend calls the backend interface
4. Error messages and/or full log output:
5. What I already tried:
6. Links to relevant resources:
rainyu:
1. Caddy version (caddy version
):
Caddy v2
What version, exactly ?
Show example requests.
rainyu:
Error messages and/or full log output:
Show your logs.
Please completely fill out the help topic template, we can’t help unless you help us help you.
system
(system)
Closed
May 10, 2022, 7:34am
5
This topic was automatically closed after 30 days. New replies are no longer allowed.