Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subdomain Routing in Meteor js

Any ideas on how subdomain routing can be achieved with meteor?

Or would it be best to use a reverse proxy such as nginx or HAproxy?

i can use something like /?s=subdomain in nginx

But that seems like a hacky way to achieve what should be possible with the router

I ahve no idea what the caveats will be (being new to meteor)and whether it can be counted on in a produciton environment w/high traffic(the routing call I mean).

any idea how meteor achieve his on their server?

EDIT: specifically how to achieve http://subdomain.example.com routing to Collection.content.find({'domain':'subdomain'})

EDIT #2 : I have achieved this using nginx, solution to follow. but please see this question which answers most of my concerns and gives me a way to also achieve this with node : nginx vs node-http-proxy.

like image 980
Paul Harwood Avatar asked Nov 13 '22 04:11

Paul Harwood


1 Answers

It would probably be best to look into something like node-http-proxy to solve your problem. I had a similar routing problem (when bundled and deployed) and it solved mine!

https://github.com/nodejitsu/node-http-proxy/

like image 137
Kendrick Ledet Avatar answered Nov 15 '22 08:11

Kendrick Ledet