1. Caddy version (caddy version
):
v2.4.6
2. How I run Caddy:
systemctl restart caddy
a. System environment:
OS, Ubuntu, systemd
b. Command:
systemctl restart caddy
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --resume
#--config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
test2.profile.shop {
rewrite * /mayaseen{path}
reverse_proxy https://profile-shop-1zlp7t7b2-badals.vercel.app {
header_up Host {upstream_hostport}
header_up X-Forwarded-Host {host}
}
}
3. The problem Iâm having:
Hello, after 200 cigarettes in an attempt to set up this rather complicated thing, I decided that I needed help. All seekers of help related to reverse proxy wanted https://bla.com/v1
to point to https://bla2.com
, and how to get https://bla.com
to point to https://bla2.com/v1
?
and when request https://bla.com/blah
behind the scene loading bla2.com/v1/blah
And a real example:
https://profile-shop-1zlp7t7b2-badals.vercel.app/mayaseen/product/3837732082
this is what I would like to look like:
https://test2.profile.shop/product/3837732082
Thanks in advance.