How to handle subdomains #3103
Unanswered
AeonSolstice
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I want to handle
api.my.domain
andall.my.domain
separately frommy.domain
. I tried using Host extractor but nothing worked. I looked into the wildcard path routing but the docs are so obscure about that.Store where? "Captured at key" - what does that even mean?
Then I found https://github.com/tokio-rs/axum/blob/main/axum/src/docs/routing/route.md where a new syntax was being used?
Any why does wildcard not handle
/
?Furthermore, any code that I did get to compile silently sent an error as the http body, and was not helpful in any way.
The only discussion I found regarding axum and subdomains had a non working solution, not to mention "use reverse proxy" "use nginx" "dont handle that with axum" "use loadbalancer" "dont do it like this"
I do not want to do any of that. I just want to handle subdomains in rust code directly. Any help besides "use nginx" is appreciated.
If this sounds like a rant, it is probably because I come from a nodejs + express background.
axum version
=0.7.9
Beta Was this translation helpful? Give feedback.
All reactions