hi , every one
this is my first post and i am happy to have friends like you. i just came over to elixir with have some ruby background and i feel elixir is some kind better that ruby.
i want to create a simple blog . but in user model i ask my user if have any domain name (he fill www.mydomain.com). they fill they own domains and obviously they change domain dns as i say to them .
how could possible when visit www.mydomain.com , it loads my app and go to user post (or user personal blog) is there any kind of package that help me in control domain .
I’d probably forward proxy them with the data via nginx, but if you want to do it pure phoenix you can bind to all then dispatch differently in the router, or fill in extra data for the controllers in your router, or do it all in the controller if all sites have the same kind of path structure.
i think i should be a filed of user table . and check the domain in some how !!
i don’t know if i could explain my exact propose
this is the form of route that i want . mydomain.com/blog/user1239 == user1239-domain.com
and i guess i want to route more than 500 domain
i doubt if my needed can be handle and done by elixir.
do you have idea how i route more than one domain ? i wounder if you could explain with some code.
You could easily do that remapping via nginx or most other web servers.
Otherwise in you Router you can test the address they used to access it and do the remapping yourself, probably only be a line or three of code.
you can setup NGINX to rewrite blah.yourdomain.com/something to whatever url format you want
yourdomain.com/blah/something or whatever would work for you. Alternatively Conn has host info
you can use to do whatever is that you intend to do.