fanout / django-eventstream

Server-Sent Events for Django
MIT License
650 stars 85 forks source link

Documentation for production deployment #11

Closed PhilippeTrounev closed 6 years ago

PhilippeTrounev commented 6 years ago

Hi,
I am trying to figure out how to deploy fanout/event stream to production. I have a beta server on elastic beanstalk under https://beta..io . It has all the Certificates provisioned by AWS.

So I've created a production realm in fanout.io for the production version of my site. I created fanout..io and now I wanted to clarify the recommended approach.

Should I essentially have two clusters one for real time with fanout and one for my production. Or do I just put my service behind fanout as a reverse proxy.

I am a bit confused as to how I should set it up.

Then the question about SSL comes to mind, is there a pragmatic way for me to refresh my certificates with Fanout using letsencrypt for example. Or do I have to update the certificates manually.

I couldn't find any deployment instructions in the docs, so I decided to bring this up here, in case others are looking for similar instructions.

jkarneges commented 6 years ago

Hi Philippe,

You shouldn't need two clusters for production, but you might consider using two domain names that ultimately route to the same cluster, e.g.:

Then client requests to either domain will arrive at the same Django app. Be sure your settings.ALLOWED_HOSTS is configured to allow both domains.

For SSL you'll need to manually update the certs in the Fanout control panel. We are considering adding support for LetsEncrypt in Fanout Cloud later this year.

PhilippeTrounev commented 6 years ago

Thank you Justin. It all works perfectly! I'm surprised at how easy this is, tbh...

jkarneges commented 6 years ago

Glad to hear it :grin: