I assume this script is long. In this case, you need to separate the process from the terminal that you want to close when you end the ssh session.
In fact, you have already completed most of the work by reassigning both stdout, and stderrto /dev/null, however you have not done so for stdin.
I used a test case:
ssh localhost
nohup sleep 10m &> /dev/null &
^D
While
ssh localhost
nohup sleep 10m &> /dev/null < /dev/null &
^D
-, gnu screen, , .
, , script , ? :.
ssh user@host script.sh