At least for Youtube and Facebook you don't need ffmpeg or any kind of recoding at your side. Nginx-rtmp fits totally, as long as you find a common bitrate for the providers. But: The providers/services you mean should support rtmp upload and provide an url-encoded scheme consisting the particular streamkey for your account there. Otherwise you couldn't specify the target at nginx configuration file level.
But you need a fortress in the internet, a vps server at least, for the nginx-rtmp. Cause you will upload to it once, if possible. The server then targets the service providers each (means n times bandwidth with n the number of target platforms/providers). In total sums to (n+1) times the bandwidth you send from your side.
I can't describe the whole way of setting up an rtmp server on the inet (and its out of scope for this forum, to mention), but a small last hint:
In the config file of the nginx you will insert into the rtmp->server->application section single directives for each service/provider like
"push rtmp://[server-ip]/[url-encoded-ingest-point-and-your-streamkey] ;"
Then with "push_reconnect 10s;" for instance you can say that the server retries every 10 seconds if his connection to the target service gets lost for a moment.