Has anybody experience in serving static files from a remote server that is hosted by yourself?
I can’t use any external provider but have a lot of VM capabilities in our private computing cloud.
I would especially like to know
FS or DB?
Do you also use a minimal Meteor or other Node backend?
What were the biggest challenges you experienced?
I found a lot of articles on the net with many different ways of serving static assets so it would be great to see how people from the Meteor community approached this topic.
I deployed on Digital Ocean. Used meteor-files to manage the upload and files collections for small json/geojson sample files. This package has a lot of easy integrations with AWS and similar, but i did not test it.
Honestly, my biggest challenge was to understand the better project structure and the best place to put files into, where the client could have access to them via a download route. After some struggle the package i mentioned worked like a charm
I have the requirements to not use an external service but host the file server on my own but for scaling issues I won’t serve them with the same Meteor instance but on a dedicated instance with the sole purpose of serving static files.
I’m using nginx as a reverse proxy - basically, anything under http://foo.bar.baz/static gets served up by nginx directly while any other URL gets the Meteor instance.
While both (i.e. static files and Meteor) reside on the same server in my case, there’s nothing which prevents you from spreading things over several servers. This would probably be the easiest setup in your case and you can also use nginx for SSL.
This is really helpful. Now one question to that - how would I have to configure the nginx if the static content would be served by another server and not from the same machine?
The other server (and the static files) would be available by a public IP that would be mapped to a subdomain like static.mysite.com in our DNS entry file.
Basically, similar to what we’re already doing with serving Meteor content. Only you don’t need to fiddle around with the headers as much because your static content server won’t care as much.