Domain for each user

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 .

tanks

1 Like

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. :slight_smile:

3 Likes

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.

tanks

any other idea !?

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. :slight_smile:

1 Like

tanks OvermindDL1

but i don’t understand :sweat_smile:

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.

2 Likes