satman81
(SATMan)
February 25, 2023, 11:39am
1
1. The problem I’m having:
I have just a general question if it’s possible with CaddyFile.
i have a subdomain test.example.com pointing to caddy server.
using CaddyFile i am doing
test.example.com {
reverse_proxy :8081
}
and it’s working perfectly.
Now i need more than one proxy running on the same server, instead of creating more subdomains on DNS side, i want it to handle at caddy side:
test-1.example.com {
reverse_proxy :8081
}
test-2.example.com {
reverse_proxy :8082
}
test-3.example.com {
reverse_proxy :8083
}
Please note that only test.example.com ’s A record is pointing to caddyserver. So is it even possible using CaddyFile?
3. Caddy version:
2.6.4
4. How I installed and ran Caddy:
ubuntu/debian package
a. System environment:
Ubuntu 20.04
You must configure DNS to point to your server’s IP address, otherwise no browsers on the internet will know how to reach your server for those other domains.
You can use a wildcard subdomain like *.example.com
in your DNS to make all subdomains resolve to your server.
satman81
(SATMan)
February 25, 2023, 1:05pm
3
hmmm,
well the issue is, my domains are like:
alpha.example.com → pointing to caddy_server_1
bravo.example.com → pointing to caddy_server_2
where alpha has further: alpha-1.example.com alpha-2.* same way with bravo-n etc…
if that is not possible then could I configure in this way?
alpha.example.com/one
reverse_proxy :8081
alpha.exampe.com/two
reverse_proxy :8082
?
You need to configure each subdomain individually, or use a wildcard. There’s no in-between with DNS.
To clarify, that question doesn’t have to do with webservers, it’s about how DNS works.
You could do *.alpha.example.com
though.
See this article:
Have you ever tried to reverse proxy an app into its own little subfolder of your domain name?
Makes things neat, doesn’t it? Using example.com/foo/ for one app, example.com/bar/ for another. If you’re coming here from one of the selfhosted communities, you might be thinking along the lines of example.com/sonarr/, example.com/radarr/ etc.
Chances are, you’ve tried some configuration along these lines:
example.com {
redir /sonarr /sonarr/
handle_path /sonarr/* {
reverse_proxy localhost…
satman81
(SATMan)
February 25, 2023, 1:25pm
5
Thanks, I’ll try that at my domain provider first.
if that works then will that config work?
test1.alpha.example.com {
reverse_proxy :8081
}
test2.alpha.example.com {
reverse_proxy :8082
}
test3.alpha.example.com {
reverse_proxy :8083
}
?
system
(system)
Closed
March 27, 2023, 1:26pm
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.